Results 1 to 8 of 8
  1. #1
    Vandacardoso is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    29

    Calculate final date

    Hi,

    I need to calculate the final date based on the begin date and the number of days. The name of the fields are: sdatainicio; diasatribuidos; sdatafim.
    Can someone help me?


    Regards

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    set final date 30 days from sdatainicio...
    [final date] = dateAdd("d",30,[
    sdatainicio])

  3. #3
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    Have you tried: sdatainicio + NumberOfDays

    Ron

  4. #4
    Vandacardoso is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    29
    it is not working. I have a field with the number of days.
    In my DB I give the begin date, the number of days and then I want the result to be... the final date.
    With Your formula I don't have any results at all.

  5. #5
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    Are you doing this in a query? Can you post the SQL string from the query you created.

  6. #6
    Vandacardoso is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    29
    No, is not in a query. I want to put in a Form.

  7. #7
    IrogSinta is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    103
    So is it in a Textbox control? If so, just put the either of these expressions in the ControlSource of the textbox:
    = [sdatainicio] + [NumberOfDays]
    = dateAdd("d",[NumberOfDays],[sdatainicio])

  8. #8
    Vandacardoso is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    29
    It works!!!! Thank You IrogSinta! I put the line You wrote.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-26-2013, 09:25 AM
  2. Replies: 3
    Last Post: 09-14-2013, 10:36 AM
  3. Replies: 1
    Last Post: 02-12-2013, 03:48 AM
  4. Replies: 7
    Last Post: 01-28-2013, 05:21 PM
  5. Calculate Date Field
    By RachelBedi in forum Access
    Replies: 3
    Last Post: 01-09-2013, 04:14 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