Re: Select Date field problem

From: The Ghost <The_at_Ghost.com>
Date: Tue, 06 Feb 2001 14:07:04 GMT
Message-ID: <cyTf6.68751$KP3.19892772_at_news3.rdc1.on.home.com>


 lpad('2','2','0') -- will return '02'
 lpad('31','2','0') will return '31'
  --

"Greg Kearney" <sticinc_at_mediaone.net> wrote in message news:Y1Jf6.4772$En4.131568_at_typhoon.jacksonville.mediaone.net...
> My program is a calendar application where month/days 1-9 are single
 digit.
> When I use
> select * from events where
> to_char(start_date,'MM')= ?;
> the database is looking for two digits. Is there another way to write this
> statement where the database will understand a single digit?
>
> Greg Kearney <sticinc_at_mediaone.net> wrote in message
> news:lJDf6.4704$En4.124558_at_typhoon.jacksonville.mediaone.net...
> > I having a small problem with an O8i database date field, I'm sure its
> > something I did.
> >
> > Example:
> > select * from events where start_date like to_date('02','mm')
> >
> > This command will pull up only one record, I have 3 Feb records. If I
 change
> > the 02 to something else I get nothing, even though I have records. If I
> > change the "like" to an "=" I get no records.
> >
> > Does anybody have any suggests?
> >
> > Thanks.
> >
> >
>
>
Received on Tue Feb 06 2001 - 15:07:04 CET

Original text of this message