Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Subtract a day from a set of Dates

Hello,

I am trying to display a set of dates with the day being one day earlier. example:

I want 12/12/2010, 12/13/2010, 12/14/2010

to be 12/11/2010, 12/12/2010, 12/13/2010

Can anyone help me with the code to subtract one day from a set of dates?

2 Replies
Anonymous
Not applicable
Author

Hi,

Depending on the format you could add a line to your script, something like:

=Date(DateField-1) as DatePreviousDay

or use:

=Date(DateField-1)

in an expression.

Not applicable
Author

Date(DateField-X) works fine. X being the number of days to subtract.

If it doesnt work your date might be a string so you must convert your date back to a number: num(date())

Id recommend throwing your calcualtion into a variable as well