Re: listing data after a certain date

From: H. John C. Hopkins <john_nospam_at_hpe.ufl.edu>
Date: 1998/03/12
Message-ID: <6e8r9u$ovi_at_no-names.nerdc.ufl.edu>#1/1


Hello

You need to put the date in single quotes:

SELECT
   name,
   ssn
FROM
   junk
WHERE
   date > '01-MAR-98'
;

Converting to number format won't work, and does nothing for you. It's a date, not a number. (However, using a to_char with a format 'DD-MON-YY' would work.) Your date is stored as a DATE datatype, so the date string is all you need.

HTH
JCH dwarakv_at_hotmail.com wrote in message <6e70s0$48i$1_at_nnrp1.dejanews.com>...
>Hi,
> I need to write a query which lists data after a certain date. The
>following query is what I have tried writing but have been unsuccessful
 with
>it.
>
> Select name, ssn
> from junk
> where date > to_number(1-MAR-98)
>
>The columns in the table are name varchar2(25)
> ssn number(9)
> date date
>
>I have tried the select statement without converting to a number format and
>the query doesn't work then either. Can someone out there help me with this
>query.
>
>Thanks
>Dwarak
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Thu Mar 12 1998 - 00:00:00 CET

Original text of this message