Results 1 to 4 of 4
  1. #1
    dubsdj is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4

    Smile dateadd help

    Hi I'm trying to add 10 days to a value but I don't want to include weekends or holidays say between June the 15th and June the 20th are a holiday as an example.

    DateAdd("d",+10,[Loan Date])

    I cant seem to figure out the weekday feature and how I can also include between dates to ignore.



    I want this in a query.

    any help greatly appreciated thanks

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,786
    Take a look at: Doing WorkDay Math in VBA

    http://www.mvps.org/access/datetime/date0012.htm


    There is a function named: Function dhCountWorkdaysA


    It gives a count the business days (not counting weekends/holidays) in a given date range.

    There are many useful date functions on this page.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  3. #3
    dubsdj is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    4
    Thanks

    I am also trying to do this:

    IIF (DateDIFFW([Due Date],[Return Date]) > 10, [Fine] + 1.00

    which says if the result of the DateDIFFW module is greater than 10 then add 1.00

    but i get a syntax error

  4. #4
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,786
    The syntax for the IIF() function is

    Code:
    IIF(Condition, value if TRUE, Value if FALSE)
    You are missing the FALSE part and the closing parenthesis.

    Try:

    Code:
    IIF (DateDIFFW([Due Date],[Return Date]) > 10, [Fine] + 1.00, [Fine])
    or

    Code:
    IIF (DateDIFFW([Due Date],[Return Date]) > 10, [Fine] + 1.00, "")
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

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

Similar Threads

  1. Problem with DateAdd
    By Lo-Wang in forum Queries
    Replies: 6
    Last Post: 02-13-2019, 10:55 AM
  2. Help Please - DateAdd Function
    By graviz in forum Queries
    Replies: 3
    Last Post: 03-02-2010, 02:34 PM
  3. Change Between by DateDiff or DateAdd.
    By wagner.bts in forum Queries
    Replies: 1
    Last Post: 06-05-2009, 11:24 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 - Senior Forums