I need to calculate a date. I am unsure how to ask the question so I will try to explain:
Today is Tuesday Jan 04, 2011, one year ago it was Tuesday Jan 05, 2010 and two years ago it was Tuesday Jan 06, 2009.
The reason I need this function, if you want to call it that, is we run 2 and 3 year comparinson reports. I run the same report 3 times for the 3 different days. I would like to run this report once and be done with it. Does anyone have a function that would solve my problem? Also it would have to account for leap year.
If you have any questions please let me know.
Thanks DavidThis message has been edited. Last edited by: Kerry,
January 04, 2011, 04:28 PM
Francis Mariani
Today is Tuesday, January 4, 2011.
One year ago it was Monday, January 4, 2010.
etc.
This is a program that calculates the dates. It uses the DATEADD function. Since the program uses Dialogue Manager variables in the function, the variable is converted to a date field using the DATECVT function, then to be able to use the results of the DATEADD function, DATECVT is used once again to convert the result back to an integer. DATEADD most likely takes care of leap years.