Hi,
 
Try to use 
 
SELECT Count(C18099) FROM T1116 WHERE C18099=1 AND C3<'$TIMESTAMP$'-604800
 
on the contrary of
 
SELECT Count(C18099) FROM T1116 WHERE C18099=1 AND C3<"$TIMESTAMP$"-604800
 
 
Att,

Tadeu Augusto Dutra Pinto
-----------------------------------------------------------------
IT Web Services ATM 
Cinq Technologies
http://www.cinq.com.br 
<https://webmail.cinq.com.br/exchweb/bin/redir.asp?URL=http://www.cinq.com.br/> 
 
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
Fone: 41 3018-2833 - Cinq
-----------------------------------------------------------------
Confiabilidade, Inovação e Qualidade em T.I.
________________________________

De: Action Request System discussion list(ARSList) em nome de Payne, George
Enviada: qua 23/7/2008 16:09
Para: arslist@ARSLIST.ORG
Assunto: Limiting SQL select statements by AGE


** 

ARS 7.0.01 P05

DB Oracle 10g

 

I'm looking to make a "Set Fields" Filter Action to Count the number of records 
in an ARS Table where the value of the field is '1' and the record is more than 
1 week old.

 

This SQL works fine (returns a value for $1$ of =392):

 

SELECT Count(C18099) FROM T1116 WHERE C18099=1

 

But it fails when I try to add the criteria for the age of the record (throws 
an error: ARERR [552] Failure during SQL operation to the database : ORA-00904: 
"07/23/08 14:06:46"-604800: invalid identifier):

 

SELECT Count(C18099) FROM T1116 WHERE C18099=1 AND C3<"$TIMESTAMP$"-604800

 

I've used the "$TIMESTAMP$"-604800 worked from an Advanced Search on the User 
Tool...I'm sure it's just something to do with either my SQL syntax or the way 
the "Create Date" (C3) is stored on the database.  I know it's out there as 
number of seconds since 1/1/70, but the error seems to indicate that the 
"$TIMESTAMP$" is being interpreted as "07/23/08 14:06:46".  Maybe I need to use 
a FUNCTION for Timestamp that Oracle understands??

 

Thanks in advance,

George

 

George Payne

Corporate Applications Developer

Electric Reliability Council of Texas

(512) 248-3940

[EMAIL PROTECTED]

__Platinum Sponsor: www.rmsportal.com ARSlist: "Where the Answers Are" html___ 

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

Reply via email to