Lyle,
 
You are correct. I was not thinking correctly.. Do not replace the AND with OR, 
else it will always be true. (Not sure what I was thinking :-) ) So I apologize 
for a wrong suggestion. Do change the position of $TIMESTAMP$ to avoid more 
calculations than is necessary..
 
( 'Type' = "Normal") AND (('Planned Change Date' <= (((60 * 60) * 48) + 
$TIMESTAMP$)) AND ('Planned Change Date' >= (((60 * 60) * 36) + $TIMESTAMP$)))
 
ALSO, do not forget to index 'Planned Change Date' indexed if you are working 
with a significantly large number of records.
 
Joe
 
-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:[email protected]]on Behalf Of Lyle Taylor
Sent: Monday, October 19, 2009 2:31 PM
To: [email protected]
Subject: Re: Time Calc


No, that’s not right.  Putting OR will always cause it to be true, because 
every date will either be less than 48 hours in the future or greater than 36 
hours in the future. It should stay AND.  It looks correct to me with AND so 
long as it’s a Date Time field and not just a Date field (in which case you 
can’t do this anyway).
 
Lyle
 
From:Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Joe DeSouza
Sent: Monday, October 19, 2009 12: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 ANDinstead of ORyou 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"

Reply via email to