tigin44,
That is exactly the same query as posted by the asker.
RQuadling,
There are other options, but I think the one used is the "best". You can count e.g. with
Main Topics
Browse All TopicsHi.
Am I missing anything by the snippet below.
Is summing the only way to count the values (not the distinct values)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
That does not make a big difference - it was the figure, to show alternatives. And I did realize you assign the values to vars - but it was totally unimportant. You already seemed to be able to do that yourself.
Did you realize that tigin44 did not answer your question at all? Your query is correct, and the slight variation he supplied does not change anything to that.
Business Accounts
Answer for Membership
by: tigin44Posted on 2009-10-26 at 07:15:50ID: 25662431
try this
SELECT
@i_StartedWith = COUNT(*),
@i_Dead = SUM(CASE WHEN CRR.DateRemoved IS NULL THEN 1 ELSE 0 END),
@i_Live = SUM(CASE WHEN CRR.DateRemoved IS not NULL THEN 1 ELSE 0 END)
FROM
dbo.CachedRemovalReasons CRR