Question : Now function plus 6 hours

I am trying to find records from a table where the created time is 6 hours in the future.  Is this the right way do it so I can find records that were created in the last 30 minutes since the server time is 6 hours ahead of my local time?

>TimeValue(DateAdd("n",-390,(Now()-360)))

Answer : Now function plus 6 hours

Hi Fairfield

First, 6 hours is 360 minutes, so DateAdd( "n", 390, Now() ) will be 6.5 hours in the future.  As the server clock is only 6 hours ahead of your clock, you are looking for records that have not yet been created!

Try this:

>DateAdd( "n", 330, Now() )

Although it is more long-winded, it might be clearer to use:

>DateAdd( "n", -30, DateAdd( "h", 6, Now() ) )

--
Graham

Random Solutions  
 
programming4us programming4us