How to add a year to a Date?

Results 1 to 3 of 3

Thread: How to add a year to a Date?

  1. #1
    Join Date
    Dec 1969
    Posts
    29

    Default How to add a year to a Date?

    Hi,<BR><BR>I&#039m just wondering how to add a year to a date.<BR>I have a shipped date and want to check when warranty ends, which is either shipped date + 1 year or + 2 years.<BR><BR>So far I&#039ve been using Left and Right-functions to make it possible, but when changing from one server with one language setting (and datesettings) to another with other date settings, it all gets messed up. So, is there a generic way to handle it?!<BR><BR>BEst regards<BR>Niclas, niclas@ducati.org

  2. #2
    Join Date
    Dec 1969
    Posts
    30

    Default RE: How to add a year to a Date?

    YOu can get the year using year function.<BR>Eg.<BR><BR>yearvar = year("10/10/1999")<BR><BR>this will return 1999 to yearvar.<BR><BR>Suraj

  3. #3
    Join Date
    Dec 1969
    Posts
    29

    Default RE: How to add a year to a Date?

    Well, that wasn&#039t really what I wanted.<BR><BR>but I did find a solution to what I wanted:<BR><BR>DateAdd("yyyy",1,dShippedDate)<BR>< BR>adds one year to my shipping date.

Posting Permissions

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