dcsimg
Results 1 to 2 of 2

Thread: counting rows of an msaccess database table

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2017
    Posts
    8

    counting rows of an msaccess database table

    I am trying to summaries daily attendance table (tblTimeLog) to create Monthly attendance data (tblMonthRecord) where through query; Fields like Overtime, Late, Number of days Present are calculated. There is a column named Holiday_In where Sunday Entries were recorded. Now I also like to count the number of sundays worked. But It is not working. Everytime I got only zeros.

    Query is:

    Code:
    SELECT  First(tblTimeLog.[LogDate]) AS FirstDay, tblTimeLog.NAME, Sum(CDate([OT])) AS Sum_OT, Sum(CDate([LATE])) AS Sum_LATE, Sum(CDate([E_ARRIVAL])) AS Sum_E_ARRIVAL, Sum(CDate([L_DEPT])) AS Sum_L_DEPT, Sum(CDate([L_IN])) AS Sum_L_IN, Sum(CDate([E_DEPT])) AS Sum_E_DEPT, Count(tblTimeLog.[LogDate]) AS DayCount, tblTimeLog.EM_ID,  Count(tblTimeLog.HOLIDAY_IN) AS NumberOfSundays
    FROM tblTimeLog
    WHERE (((tblTimeLog.OT)>"0") AND ((tblTimeLog.LATE)>"0"))
    GROUP BY tblTimeLog.NAME, tblTimeLog.EM_ID


    tblTimeLog Data Sample:

    Name:  Untitled.jpg
Views: 150
Size:  15.3 KB

    Hope some body will fine me with the solution thank you..

  2. #2
    Addicted Member Cristian's Avatar
    Join Date
    Jun 2006
    Posts
    228

    Re: counting rows of an msaccess database table

    What are the field types of tblTimeLog.OT and tblTimeLog.LATE ?
    Are they datetime or String?
    Maybe the "Where" Condition is not working properly because you must to convert that fields before comparing

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width