sql - group by access seperate column -
i'm new sql , have following (seemingly simple) database query.
i have table containing timetracking information set of employees:
date employeeid timein timeout 01/01/20 1355 12:00 4:00 01/01/20 1355 4:30 6:00 01/01/15 1234 9:00 12:00 02/01/15 5555 5:00 6:00 02/01/15 1111 1:00 4:00
foreach date, want count number of unique employees worked, ending table like:
date totalemployeesworked 01/01/15 2 02/01/15 2
there several id's ignore well. far came with:
i have tried following query in ms access 2003:
select [timetrackinglog-sql].date, count(distinct callername) [timetrackinglog-sql] group [timetrackinglog-sql].date
and complained 'missing operator', highlighting use of callername.
the news query legal (and straight forward!) ansi sql, work on sensible database. bad news ms access you're using not support syntax.
it can worked around subquery, though:
select t.date, count(*) (select distinct [timetrackinglog-sql].date, [timetrackinglog-sql].callername [timetrackinglog-sql]) t group t.date
Comments
Post a Comment