View Full Version : Group by Day


bbeeching
06-29-2005, 10:04 AM
I have an application that tracks employee "absent from work" occurances. I would like to count and sum the number of instances and on which day of the week they occur. In other words, who many times was Johnny absent on a Monday, Tuesday, etc, etc. If I group by the date field, and format for "group by day", I get one record for each group, not the expected result. Any ideas?

Thanks!
Brad Beeching

andrew93
06-30-2005, 01:41 AM
Hi Brad
If you wrap the Weekday() function around your date field in a query (e.g. Weekday([AbsentDate]), this will give you the day number of the week (from memory 1 = Sunday). You can then use this in a crosstab query to get a count of absences by employee by day of the week. Any totals would be done a report instead of the query.
HTH, Andrew :)

MStef
06-30-2005, 02:10 AM
Hello Brad!
Look at "DemoGroupDayA2000.mdb".
Here you have got "Table1", "Query1", "Module1".
You can create a report on query1.

bbeeching
07-01-2005, 04:40 AM
Thanks! I'll give both a try. If I run into any questions, as Arnold once said... "I'll be back"!