Re: More on Dates (Day numbers)
From: Naresh <nramamur_at_worldnet.att.net>
Date: 1997/12/03
Message-ID: <664385$fgs_at_bgtnsc01.worldnet.att.net>#1/1
Kirt Thomas wrote:
>
> Is there a built in function that returns the day number or day of the week?
>
> Ie, I pass it 04-Dec-97, and it returns either a string ('Thursday'), or a
> number (5 - where 1=Sunday) - I'm just doing a quick test to make sure the
> user is not selecting certain days of the week. Thanks
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> kirtt_at_macsrule.com http://www.nowonder.com http://www.sky.net/~kirtt
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> "Eagles may soar, but weasels don't get sucked into jet engines"
> .-.-.-.-.-.-.- Public Key Available at: pgpkeys.mit.edu-.-.-.-.-.-.-.
Received on Wed Dec 03 1997 - 00:00:00 CET
Date: 1997/12/03
Message-ID: <664385$fgs_at_bgtnsc01.worldnet.att.net>#1/1
Kirt,
The to_char function in ORACLE will do this for you.
To get the name of the day:-
select to_char(sysdate,'DAY') from dual;
To get the day of the week (1-7):-
select to_char(sysdate,'D') from dual;
or
[Quoted] [Quoted] [Quoted] select to_char(to_date('04-DEC-97'),'DAY') from dual;
The first parameter needs to be of type DATE....
Hope this helps...
Naresh
Kirt Thomas wrote:
>
> Is there a built in function that returns the day number or day of the week?
>
> Ie, I pass it 04-Dec-97, and it returns either a string ('Thursday'), or a
> number (5 - where 1=Sunday) - I'm just doing a quick test to make sure the
> user is not selecting certain days of the week. Thanks
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> kirtt_at_macsrule.com http://www.nowonder.com http://www.sky.net/~kirtt
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> "Eagles may soar, but weasels don't get sucked into jet engines"
> .-.-.-.-.-.-.- Public Key Available at: pgpkeys.mit.edu-.-.-.-.-.-.-.
Received on Wed Dec 03 1997 - 00:00:00 CET