cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
jumboshrimps
Level I

custom expression Today() minus seven days in query builder

Attempting to obtain all releases by date (reldate) 7 days ago from ORACLE through ODBC Connection table.

Code below returns the attached error image:

 

SELECT DISTINCT t1.PIN, t1.PCP, t1.LASTNAME, t1.COMDATE,
 t1.RELDATE, t1.JLOCAT, t1.SEX, t1.RELTYPE,
 t1.RELAUTH, t1.RELCUST
FROM schema.table  t1
WHERE  (  (  ( t1.RELDATE >= (Today() - In Days( 7 ))  )

 

2nd question:

Once I get this query straight, does JMP have an automated macro function to run this  jmpquery every Monday morning at 3:00 am?   - I  also have the JMP addon for Excel 2010. 

1 REPLY 1
pmroz
Super User

Re: custom expression Today() minus seven days in query builder

You're missing two close parentheses.

SELECT DISTINCT t1.PIN, t1.PCP, t1.LASTNAME, t1.COMDATE,
 t1.RELDATE, t1.JLOCAT, t1.SEX, t1.RELTYPE,
 t1.RELAUTH, t1.RELCUST
FROM schema.table  t1
WHERE  (  (  ( t1.RELDATE >= (Today() - In Days( 7 ))  ) ) )

If you have Oracle errors try executing the query in a SQL tool like PL/SQL Developer, Toad etc.