Results 1 to 15 of 15

Thread: [RESOLVED] Count Absent for a Month, Quartely, Weekly, etc using Query

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2004
    Location
    Jakarta, Indonesia
    Posts
    818

    Resolved [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
    Attached Images Attached Images  
    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 -


    eRiCk

    A collection of "Laku-abis" Ebook, Permanent Residence

    Access Reserved Words, a Classic Form Bug, Access Limitation, Know run Process and the Lock they hold in, Logging User Activity in MSSQL,
    Kill Database Processes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width