Jones'e
Right there with Babe
Points: 774
More actions
August 14, 2006 at 1:38 pm
#169921
I need to substract days from a date in a expression and I am not sure how to do. I can do it in sql (getdate() - 30) and it subtracts 30 days from todays date.
Want do I need to do to get this same result in a expression?
Aaron Ingold
SSCrazy Eights
Points: 9070
August 14, 2006 at 1:50 pm
#654934
Look into DATEADD(). To subtract 30 days from @date you'd use:
DATEADD(d, -30, @date)
August 14, 2006 at 1:54 pm
#654936
That worked with one minor adjustment.
In the expression I had to put DATEADD("d", -30, @date)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply