Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> How to get Day of week

How to get Day of week

From: Nicolas Bronke <news_at_TRINITY.de>
Date: Thu, 29 Apr 1999 22:40:47 +0200
Message-ID: <3728c614@news.uk.ibm.net>


How can I get the Day of a week via Oracle functions?

I tried using a function like

Create or replace function DAYOFWEEK (DTTAG IN DATE) RETURN NUMBER
AS
  TAG NUMBER;
  VALUE DATE;
BEGIN
  VALUE :=trunc(dtTAG);
  TAG := TO_NUMBER(TO_CHAR(VALUE,'D'));   RETURN TAG;
END DAYOFWEEK ; That works fine, but it depends on the NLS_TERRITORY. That means using Territory = America the week starts with sunday, using german the week starts with monday.

Does exists a better solution, which is independend from the territory?

Kind regards
Nicolas Bronke Received on Thu Apr 29 1999 - 15:40:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US