Re: Need help with simple sql syntax

From: Ari Kaplan <akaplan_at_psycfrnd.interaccess.com>
Date: 1996/04/24
Message-ID: <4lmbbe$l10_at_psycfrnd.interaccess.com>#1/1




mruggiero_at_access.ch (Markus Ruggiero) writes:

>Please bear with me, I always thought I know sql - now I have my doubts.
>Simple interactive query to access records with a particular VMS date
>field beeing at least 14 days in the past. What is the correct syntax?
>(Oracle Rdb, former DEC Rdb)
>SQL> select * from myTable where timeField < 'today - 14 days'
>How do I correctly specify 'today - 14 days'?I get all sorts of error messages.
>Thanks for helping
>---markus---
>e-mail: mruggiero_at_access.ch



Markus,

There is a simple solution for your question. Oracle references today as SYSDATE. So, to reference 'today - 14 days', you can type:

SELECT * FROM myTable WHERE timeField < SYSDATE - 14;

Good luck.
-Ari Kaplan
Independent Oracle DBA Consultant

<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> Visit my Web Page: http://homepage.interaccess.com/~akaplan   <->
<->             email: akaplan_at_interaccess.com                    <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Received on Wed Apr 24 1996 - 00:00:00 CEST

Original text of this message