People help ... There are two tables: Clients
idClient int login varchar
Messages
idMessage int dateWakeup datetime .... other fields
need for each client to count the number of entries in the table Messages in a given range of time. i tried something like this:
SELECT c.login, count(m.idMessage) FROM Clients c, Messages m where m.idClient=c.idClient and m.dateWakeup>'2010-09-01 00:00:01' and m.dateWakeup<'2010-10-01 00:00:01';
not working :((