APRIL 24
Newsgroups: comp.databases.oracle
Subject: Re: Need help with simple sql syntax
References:
==============================================================================
mruggiero@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@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: www.arikaplan.com <->
<-> email: akaplan@interaccess.com <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Back to Ari Kaplan's Home Page