|
Posted by Sam on 02/27/07 17:04
Hi,
I have one table like :
MyTable {field1, field2, startdate, enddate}
I want to have the count of field1 between startdate and enddate, and
the count of field2 where field2 = 1 between startdate and enddate,
all in the same query.
I know how to get the first part (see below), but i don't know how to
include the count of field2 where field2 = 1 in each row.
select count(field1) as field1
from MyTable
where startdate >= '01-24-2007' and enddate <= '02-25-2007' and field2
= 0
group by field1
Can you help ?
thanks
Navigation:
[Reply to this message]
|