Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with Query_Case Statement
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00833950
Message ID:
00833972
Vues:
22
Is this code being run in a Stored Procedure?

>Below is a snippit of code, that runs but doesn't return what I want. I'm trying to get a count (meetproc) of procedures assocated with a case (meetings) as the return value from my case statement. What I get is a 1 or zero which is exactly what SQL is probably supposed to do. But I don't know how to get the count at this point. Any idea's or sugguestions?
>
>Thanks
>Kirk
>
>
>case
>when isnull(dbo.ctAdmissionType.inOrOut,0) = 0
>      then (Select Count(meetprocID) from meetproc where meetproc.meetingnumber=meetings.meetingnumber)
>   else 0
>end as ProcOutCount,
>case
>when isnull(dbo.ctAdmissionType.inOrOut,0) = 1
>      then (Select Count(meetprocID) from meetproc where meetproc.meetingnumber=meetings.meetingnumber
>    else 0
>end as ProcInCount
>
Al Williams

Anola MB, CANADA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform