Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use dateadd to subtract hours based on timezone.?

Status
Not open for further replies.

TMEAGLE2

MIS
Jun 24, 2003
16
0
0
US
Hello.. Hope someone can help. Here is scenario. I have to adjust a time based on the time zone of a state. So I create a table that gives me the a list of records with original_date, and the number of hours the the time for each record needs to be adjusted. Field name tz_hours. The tz_hours field can have a 0 (don't change the time), a -1, reduce time by 1 hours, -2 reduce by 2 hours, -3 reduce by 3 hours. Trying to do some type of nested iif statement.. but not having any luck with syntax... and I can't seem to be able to use a variable for the hours in a dateadd statement dateadd("h",[tz_hours],[original_date]) which would have been easy and ideal. Anyone! Greatly appreciated as always.
 
The DateAdd() should work. Where are you attempting to do this? Is this in a query or control source or what?
What are you results when you use DateAdd()?
Is the tz_hours field numeric and the Original_date field date?

Duane
Hook'D on Access
MS Access MVP
 
How are ya TMEAGLE2 . . .

How are you determining -1, -2, -3 hrs ?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top