Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100

    Unanswered: Show working days in a report

    I know how to use code to do this but is there an expression you can use in a report to work out the number of working days between two dates?

    I basically want to replicate the "WORKDAY" function from excel.

    Any ideas much appreciated!
    Access XP & WinXP Pro

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Show working days in a report

    Originally posted by xander
    I know how to use code to do this but is there an expression you can use in a report to work out the number of working days between two dates?

    I basically want to replicate the "WORKDAY" function from excel.

    Any ideas much appreciated!
    Check out the Weekday function. You can use it in a procedure and exclude vbSunday (1) and vbSaturday (7) to count working days.


    From the Help Files:

    Weekday Function


    Returns a Variant (Integer) containing a whole number representing the day of the week.

    Syntax

    Weekday(date, [firstdayofweek])

    The Weekday function syntax has these named arguments:

    Part Description
    date Required. Variant, numeric expression, string expression, or any combination, that can represent a date. If date contains Null, Null is returned.
    firstdayofweek Optional. A constant that specifies the first day of the week. If not specified, vbSunday is assumed.

    Hope this helps.

    Gregg

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    after doing an extensive search it appears that access does not have a function that does the same job as "NetworkDays" in excel - you have to use code.

    I've got round it by running code when the users open a report that fills in a field on the table which I then reference in the report.

    I just wish that all of the functions in excel were available in access.
    Access XP & WinXP Pro

  4. #4
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445
    Originally posted by xander
    after doing an extensive search it appears that access does not have a function that does the same job as "NetworkDays" in excel - you have to use code.

    I've got round it by running code when the users open a report that fills in a field on the table which I then reference in the report.

    I just wish that all of the functions in excel were available in access.
    Most of them are.......through code.

Posting Permissions

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