Date value from datatime value in SQlServer 2008 ? [Resolved]

Posted by Arunjith under Sql Server on 6/12/2012 | Points: 10 | Views : 7587 | Status : [Member] | Replies : 7
How to get date value from datatime value in SQLServer 2008 ?




Responses

Posted by: CGN007 on: 6/12/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
PLease refer this
SQL SERVER - Retrieve - Select Only Date Part From DateTime - Best Practice
http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/

Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ravianand on: 6/12/2012 [Member] Starter | Points: 25

Up
0
Down
http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/

refer above link...


Regards,
Ravi

Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 6/12/2012 [Member] Silver | Points: 25

Up
0
Down
SELECT CONVERT(VARCHAR(10),GETDATE(),111)


Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Arunjith on: 6/12/2012 [Member] Starter | Points: 25

Up
0
Down
thanks

Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Muhsinathk on: 6/14/2012 [Member] Bronze | Points: 25
Posted by: Meswetha on: 8/4/2013 [Member] Starter | Points: 25

Up
0
Down
This one of the method to resolve the update date into sql server
http://mssqlguid.blogspot.in/2013/07/how-to-update-or-insert-date-values.html

Swethame

Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 8/5/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
We can use
1) CAST( ColumnName AS DATE)
2) CONVERT(VARCHAR(10), columnName ,111) -- By using CONVERT function we can get different date formats
3) DATEADD(D, 0, DATEDIFF(D, 0, ColumnName)) --gives you the date with default time part ( 00:00:00.000)


Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Arunjith, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response