This is my sql so far
declare @timestamp datetime
declare @dt varchar(20)
set @timestamp = '03-29-08 03:10:09'
select @dt = (datepart(@timestamp,yyyy)
)+'-'+(dat
epart(@tim
estamp,mm)
)+'-'+
(datepart(@timestamp,dd))
I need to figure out how to convert a timestamp in the above format to a string representation of a date like 2008-03-29. The final output must omit time and return only the date.
Start Free Trial