30 days ago sql code example
Example: select the date 30 days less that the todays date sql request
declare @thirtydaysago datetime
declare @now datetime
set @now = getdate()
set @thirtydaysago = dateadd(day,-30,@now)
select @now, @thirtydaysago
declare @thirtydaysago datetime
declare @now datetime
set @now = getdate()
set @thirtydaysago = dateadd(day,-30,@now)
select @now, @thirtydaysago