03-30-2011 01:29 AM
Okay, That worked for me. Thanks!
Now...
I need advise on setting up dynamic (programmatic) LocalTime values for the queries. Basically, I want to do Math_Avg queries for different intervals but always starting from current time going back by the interval amount. I can do this with expressions and math but I'm having trouble and it looks like I can only insert static sort of code in the query like Text Entry.
Ideas on what types of objects I can use and the syntax I need to pass this equivalent logic to SQL?: LocalTime <= Now() AND LocalTIme > Now() - Interval
Ed
03-30-2011 04:39 AM
Basically the idea is to calculate the time in numeric, and convert the result to text in SQL.
For example,
use expression to calculate the time for Now()-interval, like
expression = now(trigger) - 00:00:01
The interval can be in just numeric, like 0.00004
And then, write this code in SQL
LocalTime > ' "&text((expression), "mm/dd/yyyy hh:mm:ss")" '
Is this what you want?
03-30-2011 08:50 PM
My vesion of your statement:
LocalTime > ' "&text((expression), "mm/dd/yyyy hh:mm:ss")" '
gives Error: Unexpected character: "
Here is my exact substitute on LocalTime contraints after working statement with static times:
LocalTime > ' "&text((Exp_Sql1), "mm/dd/yyyy hh:mm:ss")" '
I tried other combos of parenthesis but no luck.
Ed
03-30-2011 09:04 PM
Got it...
Just needed ending &....
LocalTime > ' "&text((Exp_Sql1), "mm/dd/yyyy hh:mm:ss")" '
works great. Thanks!
03-30-2011 09:10 PM
yes, I miss a &
it should like
'"&text(...)&"'