我正在执行这个查询:
select createdate from OITM_CLONE where ItemCode ='bk1109' and U_SLV ='f'
它给出像'2013-05-04 02:28:34.000'这样的输出
但我想在变量中获取日期,所以我使用这个查询
declare @da as varchar (20)
declare @d as varchar(max)
set @d=(select createdate from OITM_CLONE where ItemCode ='bk1109' and U_SLV ='f')
select @d
但它给出的输出类似于 'May 4 2013 2:28AM'
我需要这种输出格式'2013-05-04 02:28:34.000'