Hi there,
The following statement cumulates all scanned invoices from a given day:
"SELECT CONVERT(char(10), SCANDATE, 102) AS Scandate, COUNT(CONVERT(char(10), SCANDATE, 102)) AS Number_of_scanned_invoices
FROM invoices
WHERE (Scandate IS NOT NULL) AND
(Scandate BETWEEN '" + from + "' AND '" + until_ +
"') GROUP BY CONVERT(char(10), SCANDATE, 102)
ORDER BY CONVERT(char(10), SCANDATE, 102) ASC"
SCANDATE is a normal MSSQL timestamp.
The result looks like this:
Scandate | Number_of_scanned_invoices
2008.02.11 | 4
2008.02.12 | 11
2008.02.21 | 1
2008.02.22 | 8
2008.02.26 | 26
What I need to know and what I'm trying to find out the whole day is how it can be implemented that the number of scanned invoices is cumulated not on a dayly, but a monthly basis.
It should look like something like this:
Scandate | Number_of_scanned_invoices
2008.02 | 21
2008.03 | 46
Help is of course very appreciated.
Alain
|