2015-04-20 15:32:26.840
is the record in sql table field..how can i fetch only date from the table.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Govinda Rajulu YemineniPosted Jul 9, 2015, 8:56 AM
Below approach works in Sql Server 2008 and above:
SELECTCONVERT(DATE, Column_Name)'Date Part Only' FROM Table_NameRESULT:DatePartOnly--------------2013-07-14Example 1:
SELECTCONVERT(VARCHAR(10), column_name, 112)'Date Part Only' FROM Table_NameRESULT:DatePartOnly--------------20130714Example 2:
SELECTCONVERT(VARCHAR(10), column_name, 111)'Date Part Only' FROM Table_NameRESULT:DatePartOnly--------------2013/07/14sushma sharmaPosted Jul 10, 2015, 1:20 AM
Manoj BhoirPosted Jul 10, 2015, 1:08 AM
sushma sharmaPosted Jul 10, 2015, 12:58 AM
Manoj BhoirPosted Jul 10, 2015, 12:55 AM
Nilesh JadavPosted Jul 10, 2015, 12:52 AM
Check this source:
Hope that helps thank you
sushma sharmaPosted Jul 10, 2015, 12:44 AM
sushma sharmaPosted Jul 10, 2015, 12:43 AM
Manoj BhoirPosted Jul 9, 2015, 8:36 AM
Ankit ShuklaPosted Jul 9, 2015, 8:32 AM