Not that this is a deterrent from your method, but I would bet that
activated allows NULLs, so you might want to add WHERE activated IN ('Y',
'N') or WHERE activated IS NOT NULL or something along those lines. Or,
don't allow NULLs in the column in the first place. ;-)
(Otherwise, you will get three rows in your resultset.)
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:u7**************@TK2MSFTNGP10.phx.gbl...
Lord Merlin wrote: The following statement works fine in SQL Query Analyser: SELECT
count(*) as a from NEWUSERS WHERE activated='Y'; SELECT count(*) as b
from NEWUSERS WHERE activated='N' -- It returns two values, yet when
I have it in a .asp file, it only displays the first value. Is there
anyway around this, without making two connections to the DB, and
running two seperate queries?
Why not combine them into a single query?
SELECT activated,Count(*) from NEWUSERS
GROUP BY activated
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.