September 20, 2010 at 12:42 am
hi,
I'm trying to make a count on the basis of a bit value.
SELECT COUNT(CASE WHEN ISWaiting = 0 THEN 1 ELSE 0 END) NOTWAITING
,COUNT(CASE WHEN IsWaiting =1 THEN 1 ELSE 0 END) WAITING
,DATE
FROM TBL
WHERE Date BETWEEN @FromDate AND @ToDate
GROUP BY DATE
but i'm getting the same value for both the counts. where i'm making mistake?
Early help would be appreciated much
Thanks,
Regards,
Ami.
September 20, 2010 at 12:44 am
Don't count, sum. Count bases on existance.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
September 20, 2010 at 12:53 am
Wow Craig,
Thanks,
Just now I found out the mistake and thought of posting the answer.
You are so quick and posted before me.
Thanks a lot,
Ami
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply