Results 1 to 8 of 8
  1. #1
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39

    DateAdd Function?


    I have a report field CalDate. I need an unbound report field that displays a date 30 days from the bound CalDate field.

    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    You are apparently aware of the DateAdd function. What happens when you use it? Do calc in query or in textbox. If you encounter specific issue, post description and attempted expression. Actually, days is default unit when doing arithmetic with a date value. Could simply do: [CalDate] + 30
    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.

  3. #3
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Not real familiar with writing the DateAdd Function. How would I write the expression in a textbox?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    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.

  5. #5
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    'Wrong number of arguments'

    =DateAdd([LastCal]) + 30

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Let's look at how to use the DateAdd function in MS Access:
    DateAdd ("yyyy", 3, #22/11/2003#)
    Result: '22/11/2006'

    DateAdd ("q", 2, #22/11/2003#)
    Result: '22/05/2004'

    DateAdd ("m", 5, #22/11/2003#)
    Result: '22/04/2004'

    DateAdd ("n", 51, #22/11/2003 10:31:58 AM#)
    Result: '22/11/2003 11:22:58 AM'

    DateAdd("yyyy", -1, #22/11/2003#)
    Result: '22/11/2002'


    zburns,

    You have to look at the syntax of DateAdd and then supply the parameters.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    You have mixed up the two methods I described. The second method does not use DateAdd. Review post 2.
    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.

  8. #8
    zburns is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    39
    Yeah, my screw-up. Thanks to all

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

Similar Threads

  1. DateAdd Function
    By armyofdux in forum Queries
    Replies: 12
    Last Post: 03-09-2015, 09:52 AM
  2. DateAdd Function
    By jschlapi in forum Forms
    Replies: 4
    Last Post: 10-23-2013, 01:36 PM
  3. DateAdd function for workdays?
    By 10 Gauge in forum Programming
    Replies: 2
    Last Post: 04-06-2011, 09:20 AM
  4. DateAdd Function
    By Desstro in forum Programming
    Replies: 3
    Last Post: 04-03-2011, 01:45 PM
  5. Help Please - DateAdd Function
    By graviz in forum Queries
    Replies: 3
    Last Post: 03-02-2010, 02:34 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