Results 1 to 7 of 7
  1. #1
    pc13 is offline Novice
    Windows Vista Access 2003
    Join Date
    Dec 2012
    Posts
    3

    using dates in access


    Calling all guru's: i am trying to work out the number of days from a given date, but i am new to ms access.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Check out the DateDiff() function, or perhaps DateAdd() depending on what you're trying to do.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pc13 is offline Novice
    Windows Vista Access 2003
    Join Date
    Dec 2012
    Posts
    3
    NAME RANK MoB FDOS DAYS OF SICK
    Paul LCpl June 12/10/11
    Paul Cpl July 15/01/12
    Stephen LCpl September 24/09/11
    David LCpl December 14/09/11
    Arthur Sgt April 10/10/10
    Andrew Pte December 12/12/11
    Paul Brig April 11/11/11
    Stephen Col December 06/06/12
    SMITH BRIG APRIL 17/04/12

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    There doesn't appear to be a question, here, only an example of your data!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Check out DateDiff(), along with Date() which returns today's date.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    pc13 is offline Novice
    Windows Vista Access 2003
    Join Date
    Dec 2012
    Posts
    3
    if you look at the table above, i am looking at working out how many days sick an individual has, worked out from the first day of sick, apols to missinglinq

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Trying to calculate and save the sick leave days will cause issues. Should be a field for LDOS. Then calculate the difference whenever needed, not save the calculated value.

    Use DateDiff function.

    DateDiff("d", FDOS, LDOS)

    However, if you want the first day included in the count, then +1

    DateDiff("d", FDOS, LDOS) + 1

    How do you want to deal with weekends and holidays within the date range?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Help with dates in Access 2010
    By Lars_a in forum Access
    Replies: 3
    Last Post: 04-18-2012, 07:00 PM
  2. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  3. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  4. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 PM
  5. calculating due dates in access
    By trixxnixon in forum Forms
    Replies: 0
    Last Post: 09-28-2008, 12:35 PM

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