Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

date expressions

Discussion in 'Information Technology' started by Code Agent, Nov 2, 2005.

  1. Code Agent

    Code Agent
    Expand Collapse
    Guest

    How do I get a field to calculate a future date based on the date in another
    field? For example, I want to be able to enter a date in a field and add 10
    days to ifferent field automaticaly.
     
  2. Loading...

    Similar Threads Forum Date
    Self Update On The Gurdwara Blogs Apr 3, 2017
    Sikh News BREAKING: Young Sikh Shot Dead In Jalalabad, Afghanistan . - Sikh24 News & Updates Breaking News Oct 2, 2016
    Sikh News Sikh Candidate In Hamilton Disgusted By Racist Vandalism - Newstalk ZB Breaking News Aug 22, 2016
    Sikh News Amit Jani: Trump Leverages Fear In Americans, Wrong Candidate For Our Nation's Future Breaking News Feb 18, 2016
    update Blogs Oct 16, 2015

  3. Ofer

    Ofer
    Expand Collapse
    Guest

    To add days to existing date, you can use that
    =DateField + 10

    Or, check help on DateAdd function
    =DateAdd("d",10,DateField) ' To add 10 days
    =DateAdd("yyyy",10,DateField) ' To add 10 years
    And more
    --
    If I answered your question, please mark it as an answer. That way, it will
    stay saved for a longer time, so other can benifit from it.

    Good luck



    "Code Agent" wrote:

    > How do I get a field to calculate a future date based on the date in another
    > field? For example, I want to be able to enter a date in a field and add 10
    > days to ifferent field automaticaly.
     
  4. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Use the DateAdd function. For example, in a query ...

    SELECT tblTest.TestDate, DateAdd("d",[TestDate],10) AS TestDatePlus10
    FROM tblTest;

    In query design view, the expression looks like this (in the 'Field' row in
    the design grid) ...

    TestDatePlus10: DateAdd("d",[TestDate],10)

    In the Control Source property of a text box on a form or report, it would
    look like this ...

    = DateAdd("d",[TestDate],10)

    See "DateAdd Function" in the help files for more information.

    --
    Brendan Reynolds

    "Code Agent" <Code Agent@discussions.microsoft.com> wrote in message
    news:8F47E8E1-3757-4A3D-B2BD-9B24023A430A@microsoft.com...
    > How do I get a field to calculate a future date based on the date in
    > another
    > field? For example, I want to be able to enter a date in a field and add
    > 10
    > days to ifferent field automaticaly.
     
  5. Code Agent

    Code Agent
    Expand Collapse
    Guest

    Thanks a lot to both of you. It works perfectly! My database is finally
    complete. No more staying up late at night with visions of expressions in my
    head.

    "Ofer" wrote:

    > To add days to existing date, you can use that
    > =DateField + 10
    >
    > Or, check help on DateAdd function
    > =DateAdd("d",10,DateField) ' To add 10 days
    > =DateAdd("yyyy",10,DateField) ' To add 10 years
    > And more
    > --
    > If I answered your question, please mark it as an answer. That way, it will
    > stay saved for a longer time, so other can benifit from it.
    >
    > Good luck
    >
    >
    >
    > "Code Agent" wrote:
    >
    > > How do I get a field to calculate a future date based on the date in another
    > > field? For example, I want to be able to enter a date in a field and add 10
    > > days to ifferent field automaticaly.
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page