July 8, 2016 at 1:21 pm
Is there a way to convert a column with a DATE datatype to look like the DATETIME format? The format of the HH.MM.SS.MMM would all be zeroes.
July 8, 2016 at 1:31 pm
john.p.lantz (7/8/2016)
Is there a way to convert a column with a DATE datatype to look like the DATETIME format? The format of the HH.MM.SS.MMM would all be zeroes.
Have you looked at CAST?
________________________________________________________________
you can lead a user to data....but you cannot make them think
and remember....every day is a school day
July 8, 2016 at 1:31 pm
Yes. The conversion is allowed, so the CONVERT function will do exactly what you need.
DECLARE @test TABLE (
EntryDate date);
INSERT INTO @test(EntryDate) VALUES(GETDATE());
SELECT EntryDate, CONVERT(Datetime, EntryDate)
FROM @test;
July 8, 2016 at 1:38 pm
Perfect, I must have tried so many options I didn't try the obvious. Thanks!
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply