Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dateadd (Access 2000)

    I need to make a date enter into an access field. What I need is for the date to be the same date as another date field and add 10 days. I have tried to use dateadd and can not find the right expression.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    Try:
    = DateAdd("d", 10, [YourFieldname])

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    From Access Help:
    DateAdd(interval, number, date)

    Therefore, this adds 10 days to today:
    mydate = DateAdd("d", 10, Date)

    I'm assuming that it's the same between 2000 and 97....

  4. #4
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    Great Thank you! I was just in a class and the teacher said this was a great site and fast .


    Thank you again

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    Okay, you can't do that to do your homework. And especially since the answer is available to you right in the help menu.

  6. #6
    New Lounger
    Join Date
    Feb 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    No homework . It was a two day class and it looks like I need a class on how to use help .

  7. #7
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Dateadd (Access 2000)

    Hmmmmm ...........

    I'm "reading between lines" .......

    What is being asked is how to store a calculated result in a table. This should not be done ..... it should be calculated "on demand" dynamically when the result is needed. If the stored date entry should change for any reason ...... the stored calculated result will not be correct. By calculating the result dynamically is the only way you can be completely sure that the result is correct at the time of execution.

    The basic "rule of thumb" is: Do not store a value in a table that is "dependent" on another field in a table.
    There are certain "special occasions" where it considered "allowable" to break this rule. But this is not one of those cases.

    Sure .... the DateAdd() function is the correct way to calculate the result. But it result should not be stored in a table.

    HTH
    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  8. #8
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Dateadd (Access 2000)

    Hi,
    In addition to the DateAdd function, you could also simply use =[datefield]+10 since you're dealing with days.
    FWIW.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •