Results 1 to 7 of 7
  1. #1
    PATRICKPBME is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    171

    How to calculate start and end date.

    I have searched the site for an answer to what is probably a pretty basic function, but... . Further, it appears nothing in Access is as straight forward as in Excel.

    I have one field labeled "start". The second field is labeled "end". In the first I want the start date and then want the second field to automatically calculate and enter a date 180 days later.



    Thanks in advance.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Your startDate goes into Start
    then End = DateAdd("d",180,Start)

    The link in my signature re AccessFunctions is a great reference for these built in functions.

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by PATRICKPBME View Post
    I have searched the site for an answer to what is probably a pretty basic function, but... . Further, it appears nothing in Access is as straight forward as in Excel.

    I have one field labeled "start". The second field is labeled "end". In the first I want the start date and then want the second field to automatically calculate and enter a date 180 days later.

    Thanks in advance.
    180 days or 6 months?

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Where are you doing this? Many people use the word field when they should be using "control" because they're asking about a control problem on a form. If you're trying to do this in a table field default property setting, I don't think you can use that function. It will accept things like Date() and Now(), but not much else AFAIK. At least that's 2007 behaviour.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    PATRICKPBME is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    171
    Using days, not months.

    Been a while since I asked this question and I am just getting around to using the suggestion by Orange. Using this in a query as I thought was suggested typing in:

    End=DateAdd("d",1005,Start Date).

    However, when I try to run the query all I get is "The expression you entered contains invalid syntax.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If the Start Date field has that name then you will need to surround it with brackets. [Start Date]
    Another issue with embedded spaces in names.

  7. #7
    PATRICKPBME is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    171
    Think I've got it. Thanks!

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

Similar Threads

  1. Replies: 1
    Last Post: 10-30-2016, 09:15 AM
  2. Replies: 6
    Last Post: 03-02-2016, 12:58 PM
  3. Replies: 3
    Last Post: 02-16-2016, 05:02 PM
  4. Calculate start time.
    By Mantaii in forum Reports
    Replies: 5
    Last Post: 02-28-2012, 12:31 PM
  5. Replies: 11
    Last Post: 08-04-2010, 04:26 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