time conversion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I receive data with a combined date/time field. If necessary, I have a query
that can separate this into a date field and a time field. The data
represents a location in California and a location in Maryland - these two
locations work together, so, I need to compare their data at the same
instance in time. I need to compare the data from both sites based upon
Central standard time. I get a reading for each site on the hour. How do I
adjust the time stamp for Maryland by +1 and California by -2, realizing
that, for instance, changing 1:00 AM data for California by -2 will also
change the date on the data? HELP!!!
 
The built-in date/time manipulation functions will handle this. As long as
you have the date and time together in one statement, the functions will
automatically adjust the date as you go across midnight.

To add or subtract hours, try the DateAdd() function.

To add two hours:
DateAdd("h", 2, Date/Time Value)
To subtract one hour:
DateAdd("h", -1, Date/Time Value)
 
Back
Top