Tag Archives: sql

How to extract Date portion and time portion from a datetime value.

Put this line where you would like to extract the time portion from a date in your SQL query

CONVERT (VARCHAR(10), GetDate(), 108)

and here you go if you wish to extract date part from a datetime value

CONVERT (VARCHAR(10), GetDate(), 110)