Chris,
How 'bout something like this:
SELECT date_fld, COUNT(*) AS rows
FROM Table_Name
GROUP BY date_fld
HAVING date_fld NOT IN
(SELECT date_fld
FROM Table_Name
WHERE value_fld <> 'A')
ORDER BY date_fld
HTH,
Chad
I have a table with multiple records per date, and I need to know the number of days in order, for which all occurances equal a given value. I've found a few half answers, but they're not adding up to a whole.
>
>
>8/21 A
>8/21 P
>8/22 A
>8/22 A
>8/23 A
>8/23 A
>
>
>For the above data, I need to compute the number of days (counting backwards) where all results = "A", while not counting the 8/21 "A" - EG: 2. I've got a object.method that will do it, but I'd prefer an SQL solution rather than SCANning the table and calling the method.
_________________________________
There are 2 types of people in the world: