Results 1 to 8 of 8
  1. #1
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476

    Calculating Last Day Worked

    I have a query with these fields:

    • EmplDate – DateTime
    • EmplyID --- Test
    • Hrs – Numbers


    I have a Form with the above field, but I want to add another field. I want to see how many days each/an Employee last worked from the current date they’re working.

    I.E.


    JoLMrtn 11/23/2013
    KrnEClntn 11/20/2013
    JoLMrtn 12/1/2013 7 (Last worked 7 days ago)
    KrnEClntn 12/5/1013 15 (Last worked 15 days ago)

    *I’m unable to come up with the right criteria. Any suggestions would be much appreciated!

  2. #2
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Calculating Last Day Worked

    You could look into the DateDiff Function

    https://599cd.com/tips/access/dates-...?key=AlexForum

  3. #3
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    Thanks for your reply. I'm sorry, but it seems a bit complicated for my brain Thanks again!

  4. #4
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Calculating Last Day Worked

    So how are you storing this information?
    Is it like a time sheet and you are inputting each day they work?

  5. #5
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    "Are you inputting each day they work" -- Yes.

  6. #6
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Calculating Last Day Worked

    Do you know them in advance or on the day they are working?
    Will there be future dates included?

    For example
    If I worked on Friday and then I worked on Sunday you would like the calculation to show?

  7. #7
    djclntn is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Posts
    476
    No, if you worked on Friday 11/29/2013 then you worked on Sunday, 12/1/2013 it'll tell me on "12/1/2013" Record/entry the number of days you last worked -- 2-days ago.

  8. #8
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Calculating Last Day Worked

    You can use the following Query to get the last two Records.
    Code:
    SELECT TOP 2 Table.EDate
    FROM Table
    WHERE EmployeeID=y
    ORDER BY Table.EDate DESC;
    You could then work out the difference between the two.

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

Similar Threads

  1. Replies: 8
    Last Post: 03-01-2013, 11:55 AM
  2. database worked yesterday and not today
    By ctbrown4 in forum Database Design
    Replies: 2
    Last Post: 08-17-2012, 08:43 AM
  3. calculate rate * hours worked
    By hamish mather in forum Queries
    Replies: 1
    Last Post: 12-22-2011, 06:14 AM
  4. Sum hours worked, grouped by dep't
    By goodfood in forum Queries
    Replies: 3
    Last Post: 05-05-2011, 06:11 AM
  5. Access 2010 fails where 2007 worked
    By dick in forum Access
    Replies: 3
    Last Post: 10-16-2010, 01:20 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