Graeme McGilvray
asked on
Time/Date Query
Hi there, I am not sure if this is correct or not...
What I want to do is check if these values is more than 1 hour old from the values in the DB
eg if it is 10am, are the values prior to 9am (that same day)
Any help is appreciated
Set CheckCurrency=oConn.Execute("SELECT * FROM site_curr WHERE curr_update=<#"&Now()&"# AND curr_uptime=<#"&Time()+1&"#")
What I want to do is check if these values is more than 1 hour old from the values in the DB
eg if it is 10am, are the values prior to 9am (that same day)
Any help is appreciated
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what's your database? Access?
ASKER
Hi Ryan, yes Access 2003
BigMonty, trying your code, got this error:
BigMonty, trying your code, got this error:
Expected ')'
/home.asp, line 112
Set CheckCurrency=oConn.Execute("SELECT * FROM site_curr WHERE curr_update=<#"&Now()&"# AND curr_uptime=<#DateAdd( "h", "Now()" 1 )#")
Points to the h in DateAdd
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looks very promising
And from here, I would use this IF statement to execute if it is outside 60min old?
And from here, I would use this IF statement to execute if it is outside 60min old?
If Not CheckCurrency.EOF Then
?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Cheers for that, work great! (by itself)
In reference to one of our previous questions (aspJSON), when we add this query & If statement, would there be any reason why aspJSON now become an error?
It does not error when the If statement and query commented out or if aspJSON isnt within the If statement, but within it errors, cannot figure out why
In reference to one of our previous questions (aspJSON), when we add this query & If statement, would there be any reason why aspJSON now become an error?
It does not error when the If statement and query commented out or if aspJSON isnt within the If statement, but within it errors, cannot figure out why
Class aspJSON
ASKER
when we add this query & If statement, would there be any reason why aspJSON now become an error?it shouldn't happened as both are not really "related" to each other. need to know the error message you encountered.
if it's a totally separate question, perhaps we can follow up in another new thread instead? so it's more likely to be traceable cheers.
ASKER
Yes of course, I will start another thread for it
Cheers
Cheers
ASKER