18.6.10

select only date/time part of a datetime

How can I select only date/time part of a datetime value?
--------------------------------------------------------------------------------

Answer:

--to select date part only
SELECT CONVERT(char(10),GetDate(),101)

--to select time part only
SELECT right(GetDate(),7)

No comments: