So in a table I'm working on, there is a column of times stored in string format. So 5pm is stored as '17:00'.
I'm trying to move a lot of data from this table to a second table, but the rub is the time has to be one hour later than it originally was. So '18:00' in this case.
Is there a simple way to select a string '17:00' and have it turn out as '18:00' that would fit into an insert statement? I know that
SELECT time+'01:00' from table
Doesn't work, that just spits out '17:0001:00'.
Oh and the column I'm inserting it into is configured the same as the original column, and neither can be changed. So any variable type conversion has to be reverted.
Posts
[edit: to clarify, this will still work if you're not using the TIME datatype, but I assume that's behind the limitation. It'll work on a string datatype, presumably as long as it's in the format hh:mm
Thanks for pointing me in the right direction.
http://msdn.microsoft.com/en-us/library/ms174420.aspx