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

Home -> Community -> Usenet -> c.d.o.server -> Re: querying records with date field

Re: querying records with date field

From: gpmilliken <gpmilliken_at_gmail.com>
Date: Mon, 15 Oct 2007 21:44:27 -0000
Message-ID: <1192484667.981157.168060@i13g2000prf.googlegroups.com>


On Oct 15, 11:33 am, "mrajanikris..._at_gmail.com" <mrajanikris..._at_gmail.com> wrote:
> hi,
>
> I want to retrieve records from a table by comparing the date field.
>
> select * from mytable where joindate >= <my date variable from front-
> end>
>
> my date variable contains date time value. So I want to check with
> date and time.>From the above query, I need to get records whose joindate >= 2007-
>
> oct-11 19:25:06
>
> How can I write the query to check the dates.
>
> Thanks in advance.

You can try this, replace the date string with a reference to your PLSQL variable:

SELECT * FROM MyTable WHERE JoinDate >= TO_DATE( "2007-OCT-11 19:25:06", "YYYY-MON-DD HH:MI:SS"); George Milliken Received on Mon Oct 15 2007 - 16:44:27 CDT

Original text of this message

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