Results 1 to 7 of 7
  1. #1
    shod90 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Posts
    134

    probelm with multiple attendance at same day

    Dear Gents,
    I recently created a program that manage employees attendance , It was working fine till one employee attend more than 2 times per day ( In Out then In Out again )
    attached photos to be more explained
    Click image for larger version. 

Name:	Screenshot 2023-10-30 223236.png 
Views:	26 
Size:	16.7 KB 
ID:	50970
    here at 8/5/2023 he has 4 records; I need to make a query to bring the 4 records in 1 record and calculate total working hours on that day.


    something like what i done but more flexible.
    Click image for larger version. 

Name:	Screenshot 2023-10-30 223223.png 
Views:	26 
Size:	29.8 KB 
ID:	50971
    here in that query um taking the max records from punch state I and punch state O to bring the final punch for employee, but on 8/5/2023 the query was conflicted!
    I also attached the database if anyone can help .
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    then they would have 2 records in the list, but you cannot save work hrs like that. (in time format)
    you must save it as decimal: 2.5 hrs, 1.78 hrs

    THEN you can sum the employee hrs normally.

  3. #3
    shod90 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Posts
    134
    can you edit for me the attached file , Since i cannot show 2 records in the list .

  4. #4
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    You need a ranking query to get the previous record value, have a look at the modified sample attached.
    http://allenbrowne.com/subquery-01.html#AnotherRecord
    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    shod90 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2016
    Posts
    134
    Quote Originally Posted by Gicu View Post
    You need a ranking query to get the previous record value, have a look at the modified sample attached.
    http://allenbrowne.com/subquery-01.html#AnotherRecord
    Cheers,
    That's incredible , Many thanks for the help .. If i tried for ages i won't do that , It's too complex for me actualy

  6. #6
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Not that complicated if you take it step by step, have you look at the sample file I've uploaded, the qryCheckinTotals is the final query that should give you what you want.
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  7. #7
    Join Date
    Apr 2017
    Posts
    1,679
    Quote Originally Posted by ranman256 View Post
    ... but you cannot save work hrs like that. (in time format)
    you must save it as decimal: 2.5 hrs, 1.78 hrs
    THEN you can sum the employee hrs normally.
    Or you import your data into Excel, and do the summing there

    The lack of coordination between different teams in Microsoft is sometimes incredible! The way the dates and times are defined in Excel and Access is exactly same. Almost all date and time formats in both programs are same - except one group of them. In Access you cant use formats like "[h]", or "[h]:mm"! When there is some reasonable explanation for this, I haven't seen it jet!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. attendance evidence
    By faca in forum Database Design
    Replies: 4
    Last Post: 05-21-2018, 03:57 AM
  2. Attendance Query w/ Multiple Criteria
    By jrosen12 in forum Queries
    Replies: 1
    Last Post: 01-04-2015, 12:46 AM
  3. Replies: 6
    Last Post: 01-16-2014, 12:41 PM
  4. Replies: 1
    Last Post: 05-25-2012, 04:13 PM
  5. Replies: 1
    Last Post: 08-03-2010, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums