Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL date range question

Re: SQL date range question

From: Suzanne Edgecombe <suzanne.edgecombe_at_agso.gov.au>
Date: 2000/05/25
Message-ID: <7H0X4.25$Y16.1090706@news.interact.net.au>#1/1

Hi Dave,

your where clause should look something like:

select * from mytable
where mytable.mydate < '02-MAR-2000';

dates should be in single quotes, but they are able to be used "mathmatically" - dont forget the semicolon. You can also use sysdate (which gives you system date and time) or trunc(sysdate) (which truncates the time from the system date).

cheers

Sue E

Dave Knight wrote in message ...
>I'm a newbie at SQL and I'm attempting to filter some data by excluding
>records before a certain date. I don't know how to format the line of SQL
>that will do this.
>
>I copied the following "WHERE" section (I know, I cheated) out of the SQL
>statement that was generated when I built a Crystal Report :
>
>WHERE
> ENTORDER."ESTABLISHED" > {d 2000-05-03'}
>
>SQLPlus does NOT like the formatting on this. I get the error message:
>ORA-01840: input value not long enough for date format
>
>How should this be formatted? I think the version of Oracle I'm using is
>7.2.3.
>
>Thanks,
>Dave Knight
>
>
Received on Thu May 25 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US