TSQL Date Format Query Syntax



This I am sure its easy but I can find it online

I need to return a date with time as 0000 or no time

But I dont wat to use the convert because I dont what to make it a string

I like to keep it as a  date


This 2011-02-27 10:52:46.310

would return 2011-02-27 00:00:00.000
or 2011-02-27

what to keep as date not using convert


LVL 8
Leo TorresSQL DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
derekkrommConnect With a Mentor Commented:
dateadd(day, 0, datediff(day, 0, '2011-02-27 10:52:46.310'))
0
 
bizbiz20032003Commented:
Function Date(xxxxx) ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
cast ( yourfield as date)
0
 
Leo TorresSQL DeveloperAuthor Commented:
thank you that was exactly what I am looking for
0
All Courses

From novice to tech pro — start learning today.