How do I increase data in column by 5

G

Guest

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"
 
G

Guest

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/
 
R

Rick Brandt

KIMA06 said:
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.

"Adding 5" cannot be resolved accurately until you answer the question in my
previous post.

What kind of data type is this field?

Also, in looking at both your posts it is not clear to me whether you want to
modify ALL rows or only those in a particular zone. If the latter how can you
identify those? By the value they currently contain or do you have other fields
that need to be used to filter on?
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top