Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...If there has ever been a justification needed for access to the net during working hours, just referring to this site should suffice. Fantastic!..."

Geography

Where in the world do Tek-Tips members come from?

use dateadd to subtract hours based on timezone.?

TMEAGLE2 (MIS)
29 May 12 22:51
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.
dhookom (Programmer)
30 May 12 0:30
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

TheAceMan1 (Programmer)
30 May 12 7:02
How are ya TMEAGLE2 . . .

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

Your Thoughts? . . .

See Ya! . . . . . .

Be sure to see FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions? Worthy Reading! thumbsup2
Also FAQ181-2886: How can I maximize my chances of getting an answer? Worthy Reading! thumbsup2

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close