Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Query_Case Statement
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Help with Query_Case Statement
Miscellaneous
Thread ID:
00833950
Message ID:
00833950
Views:
63
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
Next
Reply
Map
View

Click here to load this message in the networking platform