How do I increase data in column by 5

K

KIMA06

I am updating a large country time zone file. I want to increase the TimeZone
column by 5. For example. Afghanistan's time zone is +0430. I want to add 5
to all records so in this case the time zone will change from +0430 to +0930.
Which means that Afganistan is 9 hours and 30 minutes ahead of EST.
 
R

Rick Brandt

KIMA06 said:
I am updating a large country time zone file. I want to increase the
TimeZone column by 5. For example. Afghanistan's time zone is +0430.
I want to add 5 to all records so in this case the time zone will
change from +0430 to +0930. Which means that Afganistan is 9 hours
and 30 minutes ahead of EST.

Is "+0430" a character field? If so...

UPDATE TableName
SET TimeZone = "+0930"
WHERE TimeZone = "+0430"
 
K

KIMA06

Rick..Thanks for your response. There are 108K records in the file and all of
the time zones are different. The time zone is in GMT, but I need to add 5 to
each record in the timezone column, so that it converts from GMT to EST.
 
J

Jeff Boyce

This may be unnecessarily picayune, but "5" + "0430" is "0435". It appears
you want to add 5 HOURS to the time represented by "0430". Given the
military-style time, you'd need to add 500.

Or, if the underlying data is stored as a date/time value (and simply
displayed as "0430"), you could use the DateAdd() function (see Access HELP
for syntax).

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
K

KIMA06

You are correct. I need to add 500 to all timezone fields. However in MS
Acces help a day"d", month"m" or hour"h", must be specfied. Since this is
military time there is no day, month or hour.
 
R

Rick Brandt

KIMA06 said:
You are correct. I need to add 500 to all timezone fields. However in
MS Acces help a day"d", month"m" or hour"h", must be specfied. Since
this is military time there is no day, month or hour.

That would be true if you were using the DateAdd() function and that would only
be appropriate if your field were a DateTime data type. Is it?
 
Top