May 28, 2009 at 3:21 am
hi guys, can any help with the below sql
select getdate()
returns 2009-05-28 11:18:49.123 as datetime datatype
is there a way i can format the getdate()
to return as 2009-05-28 00:00:00.000 datetime datatype
May 28, 2009 at 3:23 am
SELECT DATEADD (DAY, DATEDIFF (DAY, 0, '2009-05-28 11:18:49.123'), 0)
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 28, 2009 at 3:30 am
many thanks
May 28, 2009 at 9:15 am
Frank Kalis (5/28/2009)
SELECT DATEADD (DAY, DATEDIFF (DAY, 0, '2009-05-28 11:18:49.123'), 0)
Might be a little more usful if it returned tomorrow's date if it is run tomorrow:
SELECT DATEADD (DAY, DATEDIFF (DAY, 0, getdate()), 0)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply