system
October 2, 2013, 8:07pm
4
Then this sticky topic can help you:
As per this topic on Oracle relative dates, here’s the same set of dates in SQL Server.
Please note that some may not work on SQL Server 2000, but all definitely work in 2005/8.
Yesterday
cast(convert(char(10),dateadd(d,-1,getdate()),23) as datetime)
Today
cast(convert(char(10),getdate(),23) as datetime)
The following also works for today:
dateadd(dd, datediff(dd,0,getdate()), 0)
Start of Current Month
cast(convert(char(7),getdate(),23)+'-01' as datetime)
End of Current Month
dateadd(d,-1…
Probably a right issues. However, it’s better to create in the universe a pre-defined condition using the relative dates from the linked topic and then to use the condition in a report query.
Marek Chladny (BOB member since 2003-11-27)