Re: PL/SQL Week days
From: Michel Cadot <micadot_at_altern.org>
Date: Tue, 3 Aug 1999 16:05:20 +0200
Message-ID: <7o6svt$55b$1_at_oceanite.cybercable.fr>
from dual;
Date: Tue, 3 Aug 1999 16:05:20 +0200
Message-ID: <7o6svt$55b$1_at_oceanite.cybercable.fr>
[Quoted] Nope. 'D' format is dependent on NLS_TERRITORY which specified implicitly the day of the week that is numbered 1.
You can check for Sunday or Saturday with the format 'D' by comparaison with a known date (01/01/2000 is a Sunday):
select decode(to_char(sysdate,'D'), to_char(to_date('01/01/2000','MM/DD/YYYY'),'D'), 'Saturday', to_char(to_date('01/02/2000','MM/DD/YYYY'),'D'), 'Sunday', 'Other day')
from dual;
DanHW a écrit dans le message <19990803011557.01161.00002610_at_ng-xc1.aol.com>...
>>A little PL/SQL question:
>>
>>How to check if a given date is a saturday or a sunday, staying independant
>>of the NLS parameters ?
>>(Oracle 8.0.5)
>>
>>Achille Carette
>>act_at_bluegate.be
>>
>>
>
>One of the date formats, I beleive it is 'D' returns 1 for Sunday... 7 for
>Saturday. I don't think that it depends on the NLS setting.
>
>Dan Hekimian-Williams
Received on Tue Aug 03 1999 - 16:05:20 CEST