Subtract one hour.

  • Thread starter Thread starter twalsh
  • Start date Start date
T

twalsh

I have a query pulling criteria from 2 tables. the goal of which is to
compare 2 times. one is a scheduled start time and another is an actual start
time. The problem is that the actual start times are in EST and the scheduled
start times are in CST. changing them before importing is not an option
should i...

A.)do an update query to change all the actual start times to remove one
hour? if so what is the expression because everything i have tried is a mess.

B.) subtract that hour in the select query that compares teh schedule and
actual times.
 
I would probably adjust the time in the comparison query.

A problem with doing the update is that you have to make sure you do the
update one time and only one time on the records. IF you forget to do so or
do so more than once then you have a problem in correcting the data.

One way to do the update is to have an additional field (yes/no) in your table
and then set that field to True when you update the time field

So your SQL statement might look like:
UPDATE YourTable
SET ScheduledTime = DateAdd("h",1,[ScheduledStartTime]
, TimeAdjusted = True
WHERE TimeAdjusted = False

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
Back
Top