Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DAYOFWEEK Function
"Anna C. Dent" <anacdent_at_hotmail.com> wrote in message news:<gGklb.79762$Ms2.41140_at_fed1read03>...
> Alister Taylor wrote:
>
> > Dear All,
> >
> > I am having a little (trans: a LOT) of trouble geeting a DayofWeek
> > function to work.
> >
> > Broadly, this is for a basic flight booking service, which stipulates
> > that a given flight is to be made on a certain daynumber.
> >
> > A flight may be made on many dates, but must be on this daynumber. I
> > think that the problem may lie in part with the date entered as ie
> > '27/OCT/2003', but this seems not to be causing problems for other
> > people within the group.
>
> Please note that Oracle is 'picky' when it comes to data types.
>
> '27/OCT/2003' is a STRING; just as is 'ABC'.
>
> You might want to look up the TO_DATE function.
Alister, here is an example statement to help you out. UT1> l
1 select to_char(sysdate,'DDD') as DayOfYr, 2 to_char(sysdate,'D') as DayOfWk, 3 to_char(sysdate,'YYYYMMDD') as ToDay4* from sys.dual
DAY D TODAY
--- - --------
295 4 20031022
Anna mentioned looking up the to_date function but what you probably should look up is the list of "date format elements" via the index used in both the to_char and to_date functions rather than the functions themselves. The information on the masks elements and the functions is usually separated by other material.
HTH -- Mark D Powell -- Received on Wed Oct 22 2003 - 07:51:24 CDT
![]() |
![]() |