Results 1 to 12 of 12
  1. #1
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14

    Adding Dates

    Hello All,

    I'm trying to figure out what I need to enter into a field.

    In one column I have a user defined date 04/19/2012. In another column it pulls in a number from a table ex: 60. I need to add the 60 to the 04/19/2012 to give me 6/18/2012. How would I do this?



    I have attached a picture of the table.

    Thanks.
    Attached Thumbnails Attached Thumbnails one.JPG  

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you looked at the DateAdd() function?

  3. #3
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14
    I did, not sure about how to type it out though. My 60 is under column "Value" and 4/19/2012 is column "Date". How would I type it?

    I tried a bunch of different ways with no success.

  4. #4
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14
    When I used the DateAdd it would display 6004/19/2012.

  5. #5
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Is your date field in your table formatted as text or Date?

  6. #6
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14
    I did have it set as a Text. I just changed it now, still confused on what the equation should be?!?!?

    Thanks

  7. #7
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14
    I figured it out!!

    Now my next question.

    Not sure how to finish this:
    I need to it Subtract 3/7/2013[Code Date] from 04/19/2012[Date] if INC/Var="M" and if Inc/Var="V" I need the equation reversed.

    Date Variance: IFF([Inc/Var]="*M*"

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    How about starting a new thread with your new issue and posting the actual line of code you used to solve the first issue will help others that read this forum.

  9. #9
    SobJim is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    14
    Code:
    Max/Min: DateAdd("d",[Value],[Date])
    was what did it. Also fixing the formatting of the Value and Code Date columns.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That should help, thanks. Are you going to start a new thread or do you want me to move it? BTW, using "/" in a name is not a very good idea. http://support.microsoft.com/?id=826763

  11. #11
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Come to think of it, "Date" is a reserved word as well: http://www.allenbrowne.com/AppIssueBadWord.html#D

  12. #12
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Thanks for starting the new thread. You will get more answers that way.

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

Similar Threads

  1. Multiple Min/Max dates by sequential dates
    By chucku in forum Access
    Replies: 2
    Last Post: 04-05-2012, 07:43 AM
  2. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  3. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  4. Adding numbers to dates
    By MFS in forum Programming
    Replies: 5
    Last Post: 11-24-2010, 12:06 PM
  5. Mixed dates - show only complete dates?
    By weeblesue in forum Queries
    Replies: 3
    Last Post: 10-27-2010, 02:15 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