Print Page | Close Window

Get DateAdd to add year inside a formula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1440
Printed Date: 07 May 2024 at 4:56am


Topic: Get DateAdd to add year inside a formula
Posted By: RealQMan
Subject: Get DateAdd to add year inside a formula
Date Posted: 03 Oct 2007 at 11:25am
Hi

Working with a formula function at this moment. I have tried two different ways of using DateAdd(), the way I called it was DateAdd("y", 1, DateValue("2007-10-04")) . Some people call it differently like this, DateAdd("y", DateValue("2007-10-04"), 1), which i think is incorrect because it gave me syntax error. Anyhow, DateAdd is not adding one year to the original date. Can anyone verify if this is a known bug? I am using VS 2005 and Crystal Report that comes with it.





Replies:
Posted By: hilfy
Date Posted: 04 Oct 2007 at 12:43pm
Looking at the help, it looks like you need to use "yyyy" to add a year.  "y" is the day of the year and adds only 1 day.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window