Solved
'COUNT' does not work
Posted on 2006-11-13
I do have following tbl 'GFArchiv'
Symbol .... DatumBerechnung ..... Technik ....... Investitionsliste ..... Unterbewertung ...
2001 JP 10.11.2006 True True False
3541 JP 10.11.2006 True False True
...
2001 JP 11.11.2006 True True True
3541 JP 11.11.2006 True True True
I would like now to count how many at each day have been 'true' on Investitionsliste, but only the ones who had 'True" in Technik like:
Date CountTechnikTrue CountInvestitionslisteTrue
10.11.2006 2 1
11.11.2006 2 2
I've tried this with
SELECT CONVERT(smalldatetime, CONVERT(char(10), DatumBerechnung, 104), 104) AS Date, COUNT(Investitionsliste) AS Expr2
FROM dbo.GFArchiv
WHERE (Technik = 1)
GROUP BY CONVERT(smalldatetime, CONVERT(char(10), DatumBerechnung, 104), 104)
HAVING (COUNT(Investitionsliste) = 1)
but it runs forever. Seems something wrong but what?
Can I count in the same step also the one where 'Unterbewertung' is true, but only the ones where 'Investitionsliste' is true as well?
thx
Kongta