I have a variable that retrieves the current date.
select
dateformat(getdate(), 'yyyy-mm-dd hh:nn:ss.SSSSSS')
What i want to do is change this so it inserts the current date - 1 day.
Does anyone know the best way around this?
Thanks
I suspect you want DATEADD
:
select dateformat(dateadd(dd, -1, getdate()), 'yyyy-mm-dd hh:nn:ss.SSSSSS')
See more on this question at Stackoverflow