can i get the date withgout the time from getdate | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

can i get the date withgout the time from getdate

can i get the date withgout the time from getdate()??
withought to need to start breaking into pieces? thnaks in advance
peleg
SELECT CONVERT(VARCHAR(10), GETDATE(), 120) will give you yyyy-mm-dd.
but will be i able to insert this returnd value into a datetime column?
Yes! If you’re going to clean up your data, you can do this in a single step UPDATE statement. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs

select dateAdd(day, 0, dateDiff(day, 0, getDate()))
Find article (written by Frank Kalis) about handling dates.
Btw, better use (…, 112). It’s considered safer with respect to regional date format settings. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs

quote:Originally posted by FrankKalis Btw, better use (…, 112). It’s considered safer with respect to regional date format settings. —
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs
Thats best as it is in universal format Madhivanan Failing to plan is Planning to fail
]]>