Results 1 to 6 of 6
  1. #1
    Chuggers75 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    10

    Query with just business days?

    Hello,
    How would I create a query that counts the number of business days only?



    Thank you,
    T

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    Import the attached module into your database and use the custom function usbNetWorkdays in your query (takes start date and end date as arguments). Note that if you want to exclude stat holidays you will need to create a table and maintain it yourself.

    Have also a look at this thread: https://access-programmers.co.uk/for...d.php?t=173982

    Cheers,
    Vlad
    Attached Files Attached Files

  3. #3
    Join Date
    Apr 2017
    Posts
    1,776
    Simply use NETWORKDAYS() function:
    Code:
    =(NETWORKDAYS(DateFrom,DateUntil)
    , where DateFrom and DateUntil must be dates, numbers representing dates, or formulas returning a date (NB! A date, not a date string!);'
    or
    Code:
    =(NETWORKDAYS(DateFrom,DateUntil, HolidayRange)
    , where HolidayRange is a reference to cell range or named range, where holiday dates or numbers representing holiday dates are stored;
    or
    Code:
    =(NETWORKDAYS(DateFrom, DateUntil, {Holiday1; Holiday2; ...; HolidayN})
    , where numbers representing holiday dates are given as array (I'm not sure about array delimiter - it may be different for different regional settings).

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,235
    NETWORKDAYS() is an Excel function; google Access + Networwdays+function and you'll get a lot of links with all kinds of solutions, but I like the one I posted the most.

    Cheers,
    Vlad

  5. #5
    Join Date
    Apr 2017
    Posts
    1,776
    Quote Originally Posted by Gicu View Post
    NETWORKDAYS() is an Excel function
    Again the same blunder from me

    Looking through forums in haste, and forgetting in which one I am!

  6. #6
    Chuggers75 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    10
    Thank you both for your help!

    Traci

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

Similar Threads

  1. Replies: 2
    Last Post: 08-16-2019, 08:36 AM
  2. Calculate Business Hours over X amount of business days.
    By gutarkomp in forum Code Repository
    Replies: 5
    Last Post: 05-16-2017, 06:23 PM
  3. Add or Subtract Business Days from a Given Date
    By orange in forum Code Repository
    Replies: 2
    Last Post: 05-15-2017, 12:45 PM
  4. Replies: 3
    Last Post: 04-03-2013, 05:53 PM
  5. CRITERIA only looks at the LAST 20 BUSINESS DAYS
    By taimysho0 in forum Queries
    Replies: 3
    Last Post: 12-06-2011, 06:27 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