Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Response: Oracle SQL query by date
fitzjarrell_at_cox.net (David Fitzjarrell) wrote in
news:9711ade0.0407291601.7dae7bcb_at_posting.google.com:
> Comments embedded.
>
> ----- Original Message -----
> From: "vnl" <vnl999_at_vnl999.invalid>
> Newsgroups: comp.databases.oracle.server,comp.databases.oracle
> Sent: Thursday, July 29, 2004 6:22 PM
> Subject: Oracle SQL query by date
>
>
>> I'm trying to run a SQL query but can't find any records when trying >> to select a certain date. Here's the sql: >> >> SELECT field 1, field2, date_and_time, >> FROM table1 >> WHERE date_and_time = '01-SEP-02' >> >> I'm getting no results. The date_and_time field is formatted like >> this: >> >> 2002-SEP-02 00:01:04 >>
>> When I run a range, the results show that records do occur on the >> single date that I am looking for: >> >> SELECT field 1, field2, date_and_time, >> FROM table1 >> WHERE date_and_time >= '01-SEP-02' and date_and_time <= '01-DEC-02' >> >> I'm wondering whether the problem may have something to do with the >> date field containing both the date and time. Any suggestions? >> >> Thanks.
Thanks David. I'm a beginner at SQL so I appreciate your help. Received on Thu Jul 29 2004 - 19:44:58 CDT