• Dateadd (Access 2000)

    Author
    Topic
    #366529

    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.

    Viewing 4 reply threads
    Author
    Replies
    • #568656

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

    • #568659

      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….

    • #568669

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

      Thank you again

      • #568693

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

      • #568708

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

    • #568747

      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

    • #568834

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

    Viewing 4 reply threads
    Reply To: Dateadd (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: