[RESOLVED] Count Absent for a Month, Quartely, Weekly, etc using Query
let say i have records like this (see the picture to make it simpler)
and the following question:
1. calculate the maximum Absent in a row for Employee A for a Week(Sunday to Saturday) in a Month?
2. calculate the Absent for Employee A for a Month?
3. calculate the Absent for Employee A for a Year?
the answer for it are:
1. Sep 2007, Week 3, 3 in a row
Sep 2007, Week 5, 2 in a row
Oct 2007, Week 2, 2 in a row
2. Sep 2007, 6 Absent
Oct 2007, 4 Absent
3. for the ilustrated it would be Total Absent = 10
can Query do something like that? using what? pls give some insight
PS: i'm using SQL Server 2000
thanks
Last edited by erickwidya; Nov 6th, 2007 at 02:02 AM.
1st NF - a table should not contain repeating groups.
2nd NF - any fields that do not depend fully on the primary key should be moved to another table.
3rd NF - there should be no dependency between non key fields in same table.
- E. Petroutsos -