Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date questions
Laura Bellini schrieb:
>
> Hi -
> Can someone tell me how to just get the day of the week out of a date in
> Oracle?
>
> For example, is 1/19/98 a 'monday', 'tuesday', 'wednesday', etc.?
>
> I know SQL Server has a function that allows you to do this - can't seem to
> find it in Oracle.
>
> Thanks in advance!
>
> Laura Bellini
> laura_bellini_at_compaq.com
First, to find out what weekday the date is, convert the date using a
format-mask:
to_char(date, 'D')
unforortunately, this only returns digits (1=Sunday...; maybe this can
be changed somewhere). So you will have to decode it:
decode(to_char(date, 'D'), '1', 'Sunday', '2', 'Monday', '3',
'Tuesday', '4', 'Wednesday', '5', 'Thursday', '6', 'Friday', '7',
'Saturday') Received on Mon Jan 26 1998 - 00:00:00 CST
![]() |
![]() |