David,
You might want also want to optimize your search while the Escalation (I'm
assuming you would use that) does what it needs to especially if you are
working against a large set of records.
Unoptimized:
( 'Type' = "Normal") AND ((( 'Planned Change Date' - $TIMESTAMP$) <= ((60 * 60)
* 48)) OR (( 'Planned Change Date' - $TIMESTAMP$) >= ((60 * 60) * 36)))
will not optimize the search for dates meeting that criteria.. First of all you
would need to index your 'Planned Change Date' field. That by itself will do
only half the job to optimize the search criteria.. Change it to..
Optimized:
( 'Type' = "Normal") AND (('Planned Change Date' <= (((60 * 60) * 48) +
$TIMESTAMP$)) OR ('Planned Change Date' >= (((60 * 60) * 36) + $TIMESTAMP$)))
That way the system will calculate the constant once, and equate it to an
indexed field, and find the results to set faster..
Joe
PS: I missed out a set of brackets in my statement in my previous mail below..
Anyway's that query while it would work will not be optimized. Perform the
Optimization steps I advised above to get better faster results..
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]]on Behalf Of Joe DeSouza
Sent: Monday, October 19, 2009 2:25 PM
To: [email protected]
Subject: Re: Time Calc
**
David,
( 'Type' = "Normal") AND (( 'Planned Change Date' - $TIMESTAMP$) <= ((60 * 60)
* 48)) OR (( 'Planned Change Date' - $TIMESTAMP$) >= ((60 * 60) * 36))
would cut it.. With AND instead of OR you will get no results to set your Type
field as the result will always be FALSE..
Joe
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]]on Behalf Of Boylan, David
Sent: Monday, October 19, 2009 1:50 PM
To: [email protected]
Subject: Time Calc
**
I need to do a small date calc. I need to set a field with a value if a Date
field is greater than 36 hours but less than 48. I’m looking at this
( 'Type' = "Normal") AND (( 'Planned Change Date' - $TIMESTAMP$) <= ((60 * 60)
* 48)) AND (( 'Planned Change Date' - $TIMESTAMP$) >= ((60 * 60) * 36))
Then do my set field. Planned Change Date is a date in the future. Am I close? J
Thanks,
Dave
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"