Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    127

    Unanswered: Access Query - Date Difference

    Need to work out the date difference between two dates

    For Example:

    Date difference = Date of Visit – Referral Date

    1 = 04/04/2006 - 03/04/2006
    20 = 04/04/2006 - 15/03/2006

    The Date difference is worked out in Calendar Days

    How do I work it out in Working Days?

    I’m using MS Access query to create the table…

    Thanks in advance

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Search for some functions to calculate the number of working days given a starting/ending date. I think I had a function to do this in the code bank under the word docs for different functions. If not, do a quick search for calculating working days given a date range. I'm sure there's one to do this somewhere.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    counting "working days" invariably leads to an acknowledgement that yes, thanksgiving and christmas are not working days

    therefore you need a calendar table which indicates non-working days

    join to the calendar table twice (visit and referral) and COUNT or SUM the working days in between

    simple
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Nov 2012
    Posts
    6

Posting Permissions

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