If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

CREATE view tmp_vw
as
SELECT
( SELECT COUNT(1) FROM tmp
WHERE TITLE = 'MR' AND datepart(mm,regdate) <= 6) M1,
( SELECT COUNT(1) FROM tmp
WHERE TITLE = 'MR' AND datepart(mm,regdate) > 6) M2,
( SELECT COUNT(1) FROM tmp
WHERE TITLE IN ('MS','MRS','MISS') AND datepart(mm,regdate) <= 6) F1,
( SELECT COUNT(1) FROM tmp
WHERE TITLE IN ('MS','MRS','MISS') AND datepart(mm,regdate) > 6) F2

[3] Option 1: Not advisable!AS you asp script time out will bother your end users or you..whoever is calling this query.
Bung this query into your ASP code(I'd use this in a stored proc and call it via ADO...