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: Simple Query Question

Re: Simple Query Question

From: Smitty <marksmithy69_at_hotmail.com>
Date: Mon, 23 Jul 2007 13:04:48 -0700
Message-ID: <1185221088.685327.240660@m3g2000hsh.googlegroups.com>


On Jul 23, 4:02 pm, G Quesnel <dbaguy_..._at_yahoo.com> wrote:
> On Jul 23, 3:29 pm, Smitty <marksmith..._at_hotmail.com> wrote:
>
>
>
> > On Jul 23, 3:23 pm, Michael O'Shea <michael.os..._at_tessella.com> wrote:
>
> > > On Jul 23, 8:09 pm, Smitty <marksmith..._at_hotmail.com> wrote:
>
> > > > Hello everyone. I have a table with a DATE column, which defaults to
> > > > the sysdate during inserts etc.. It's format is 4/26/2007 3:26:22
> > > > PM. How can I select all records from this table, where this DATE is
> > > > between two 'prompted' dates? I am a newbie, so I apologize for the
> > > > simple question. Thanks a lot.
>
> > > Hi, if you're up to using sqlplus, try something like the following.
>
> > > select something
> > > from somewhere
> > > where yourDateColumn between to_date('&d1','dd-mon-yyyy') and
> > > to_date('&d2','dd-mon-yyyy')
>
> > > Change the date mask to whatever you require.
> > > Regards
> > > Mike
>
> > Thanks for the reply. When I try this, I get the same error as I was
> > getting with mine:
> > ORA-01843: Not a valid month- Hide quoted text -
>
> > - Show quoted text -
>
> Mike added a correction which you would need... the date value must be
> in single quote.
> It looks like your problem is matching the date mask to the value you
> input.
> The value is stored internally as a date not a string, so the way
> Oracle shows the value is almost irrelevant.
> Can you show a values to you have put in?
> Is it something like 07-23-2007

That's exactly the date format I have been entering. Received on Mon Jul 23 2007 - 15:04:48 CDT

Original text of this message

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