我想你需要这个
DECLARE @tt TABLE (Sday VARCHAR(50))
INSERT INTO @tt VALUES('Jan 1 1900 10:30PM'),('Jan 1 1900 10:45PM'),('Jan 1 1900 11:00PM'),('Jan 1 1900 11:30PM'),('Jan 1 1900 11:45PM'),('Jan 2 1900 12:00AM'),('Jan 2 1900 12:15AM'),('Jan 2 1900 12:30AM'),('Jan 2 1900 12:45AM'),('Jan 2 1900 1:00AM')
SELECT Sday,DATEADD(DAY,(DATEDIFF(DAY,'1900-01-01',GETDATE())),Sday) AS resultAsDatetime,
CONVERT(VARCHAR(50),DATEADD(DAY,(DATEDIFF(DAY,'1900-01-01',GETDATE())),Sday),109) AS result
FROM @tt
这是返回
Jan 1 1900 10:30PM 2012-05-18 22:30:00.000 May 18 2012 10:30:00:000PM
Jan 1 1900 10:45PM 2012-05-18 22:45:00.000 May 18 2012 10:45:00:000PM
Jan 1 1900 11:00PM 2012-05-18 23:00:00.000 May 18 2012 11:00:00:000PM
Jan 1 1900 11:30PM 2012-05-18 23:30:00.000 May 18 2012 11:30:00:000PM
Jan 1 1900 11:45PM 2012-05-18 23:45:00.000 May 18 2012 11:45:00:000PM
Jan 2 1900 12:00AM 2012-05-19 00:00:00.000 May 19 2012 12:00:00:000AM
Jan 2 1900 12:15AM 2012-05-19 00:15:00.000 May 19 2012 12:15:00:000AM
Jan 2 1900 12:30AM 2012-05-19 00:30:00.000 May 19 2012 12:30:00:000AM
Jan 2 1900 12:45AM 2012-05-19 00:45:00.000 May 19 2012 12:45:00:000AM
Jan 2 1900 1:00AM 2012-05-19 01:00:00.000 May 19 2012 1:00:00:000AM
显然,您可以选择正确的格式将 DATETIME 转换为 VARCHAR,如 CONVERT 函数中所述,但我认为这不需要帮助。希望这可以帮助。