Frank,
This syntax will work if searching a Date/Time field, but it will not work with 
a Date (only) field.  The value on the right side of the qualification 
(($TIMESTAMP$ + (60*60*24*182)) would generate an integer value well beyond the 
range of the Date field type.  If you divided this value by 86400 (the # of 
seconds in a day) and then added the value 2440588 (the corresponding # of days 
for the DATE field type for January 1, 1970), this would theoretically work; 
however, adding these arithmetic operations to the search qualification with a 
Date field seems to generate an error in the client:

ARERR [313] Data types are not appropriate for relational operation
ARERR [312] Data types are not appropriate for arithmetic operation

So, LJ's method seems like the best (add an additional display-only DATE field, 
use the DATEADD function to add the offset from the $DATE$ keyword into the 
temp field, then use the temp field in place of the $DATE$ keyword in the 
original query against the DATE field).

--Thomas

  ----- Original Message ----- 
  From: Frank, Gordon M. (CMS/CTR) 
  Newsgroups: gmane.comp.crm.arsystem.general
  To: arslist@ARSLIST.ORG 
  Sent: Monday, October 27, 2008 10:40 AM
  Subject: Re: Adding days to a Date field in a qualification doesn't work


  An easy way to do this is to use the multipliers. You will also need to
  use $TIMESTAMP$

  'my_date_field' > ($TIMESTAMP$ + (60*60*24*182))

  $TIMESTAMP$ returns the number of seconds elapsed since midnight
  Coordinated Universal Time (UTC) of January 1, 1970. 

  Guess what platform Remedy ARS was first built upon? That's right UNIX.
  There used to be 3 clients. Anyone know what they were? Note: Remedy ARS
  was built before there was a Public Internet. Come to think of it, there
  may have been 4 clients at one time, but there may not have been one for
  IBM OS/2.

  When you do it this way, you can substitute a $variable or a number
  whenever you like.

  Gordon M. Frank
  Remedy Skilled Professional
  ITIL V3 Certified
  Lockheed Martin

  -----Original Message-----
  From: Action Request System discussion list(ARSList)
  [mailto:[EMAIL PROTECTED] On Behalf Of Mark Milke
  Sent: Monday, October 27, 2008 10:27 AM
  To: arslist@ARSLIST.ORG
  Subject: Adding days to a Date field in a qualification doesn't work

  Hi Listers,

  I have a date field on my form and I want to check, if the date
  entered isn't later than 6 months from now. I have an Active Link with
  the following qualification:

  'my_date_field' > $DATE$ + 182

  This doesn't work.

  'my_date_field' > $DATE$ works just fine. As soon as I try to add any
  number the $DATE$ variable it stops working.

  Why?


  Mark

  ________________________________________________________________________
  _______
  UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
  Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are"

Reply via email to