Question : DB2 update time

Hi,

I must be doing something silly, but cant seem to update my time columns to increase all times by say 5 hours.

i.e. current data row would be

05:00:00
13:00:00
06:00:00

After update should be

10:00:00
18:00:00
11:00:00

but my editor keeps giving me sql errors.

I've tried doing

columnname = columnname + 5
columnname = columnname + 5 hours
columnname = TIMESTAMPADD( 8, 5, columnname )

This should be easy to do, what am I missing.

I am using aquastudio btw.

Regards,
Dech

Answer : DB2 update time

...update my time columns

Because you say that you tried this:

columnname = columnname + 5 hours

...and because I'd like to assume that you were using an UPDATE statement, I have to ask if you have verified that columnname is a TIME data type rather than a basic character column that holds a time value?

Tom
Random Solutions  
 
programming4us programming4us