I have 2 fields, one containing just the date and another containing the time. I want to combine them into a proper date/time format. No matter what I try, I lose 2 days in the process. Combining
2005-12-21 00:00:00.000
and
1899-12-30 14:30:00.000
will get me the 19th at 14:30. What am I missing here?
TIAThis was addressed recently in the following thread: link (http://www.dbforums.com/t1203973.html)
Regards,
hmscott|||Thank you. I searched and somehow missed that thread. Bad choice of search words I suppose. I guess my problem was not using varchar. I had tried using convert but used datetime as the type, using a style of 101 for the date portion and 108 for the time. This seems to be working correctly:
Convert(datetime,Convert(varchar(11), DateField, 101) + ' ' + Convert(varchar(8), ReqTime, 108))
No comments:
Post a Comment