How can I convert a SQL date/time to just date?

A. The SQL date/time field stores a date and time but if you have a populated table and you want to convert a column so it lists data only run the following:update where =convert(datetime,convert(char(10),,101))For exampleupdate faqwhere created=convert(datetime,convert(char(10),created,101))

Neil Pike

February 20, 2000

1 Min Read
ITPro Today logo

A. The SQL date/time field stores a date and time but if you have a populated table and you want to convert a column so it lists data only run the following:

update

where =convert(datetime,convert(char(10),,101))

For example

update faqwhere created=convert(datetime,convert(char(10),created,101))

Read more FAQs

Also, learn more about how to ORDER BY different fields based on a variable in SQL Server and how to encrypt fields in SQL Server.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like