Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetDate()
Message
From
07/11/2003 10:20:21
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00847612
Message ID:
00847654
Views:
22
>Is there a better way to get the current date without a time than this?
>
>dateadd(ms, datepart(ms, getdate())*-1, dateadd(ss, datepart(ss, getdate())*-1, dateadd(mi, datepart(mi, getdate())*-1, dateadd(hh,datepart(hh, getdate())*-1, getdate())))) - 1

convert(datetime, convert(varchar, GetDate(), 101))

fyi: today is 11/07, and the longer version above returns 11/06
Insanity: Doing the same thing over and over and expecting different results.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform