Count, GroupBy and where SQL Statement, without GroupBy
Posted on 2007-03-28
I am having trouble in writing a SQL statement. Actually don't know if it is possible.
What I am trying to do is count a number of records but group by 1 record but also have a date from which to start counting.
So, Table 1 = UserDetails
StaffID (Numeric,Unique Identifyer), DateStarted (DateTime)
Table 2 = DataWritten
RecordNumber (Numeric, Inique Identifyer), DateEntered (DateTime)
Table 3 = RecordsRead
RecorNumber (Numeric, Unique Identifyer), StaffID (Numeric), DateRead (DateTime)
So now, I want to
Count = RecordsRead.RecordNumber
GroupBy = RecordsRead.StaffID
Where RecordsRead.DateRead = UserDetails.DateStarted (But not GroupBy DateRead).
As stated earlier, not sure, if it is possible, but would make live a lot easier.
I will be displaying this on a web page ASP Classic if this helps.