system
December 8, 2010, 7:54pm
9
Hi Alise,
This link will help you get started :-
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…
Please look at your various Oracle date / char / conversion functions, Case logic e.t.c. available to you, along with this and then post any problems you have.
Cheers,
Mark.
Mak 1 (BOB member since 2005-01-06)