Home » RDBMS Server » Server Administration » Re: First day of the FINNISH week
Re: First day of the FINNISH week [message #370651] Fri, 14 January 2000 20:45
Paul
Messages: 164
Registered: April 1999
Senior Member
Ari,
'DAY' gives the day spelled out, and I'm guessing that today, January 14th, is Friday in Finland too. Think you must be talking about 'D', which assigns a numeric value from 1-7 to the day of the week. You could always write a function to subtract 1 from that value and add 7 if the result was 0 - or try something like this:
SQL> SELECT TO_CHAR(fdate,'mm/dd/yyyy hh:mi:ss AM'),
2 TO_CHAR(fdate,'DAY'),
3 TO_CHAR(fdate,'D') as AMER,
4 DECODE(TO_NUMBER(TO_CHAR(fdate,'D')) - 1,0,7,TO_NUMBER(TO_CHAR(fdate,'D')) - 1) as F
5 FROM foodate;

TO_CHAR(FDATE,'MM/DD/Y TO_CHAR(F A FINN
---------------------- --------- - ----------
12/01/1999 07:13:14 PM WEDNESDAY 4 3
12/02/1999 07:13:14 PM THURSDAY 5 4
12/03/1999 07:13:14 PM FRIDAY 6 5
12/04/1999 07:13:14 PM SATURDAY 7 6
12/05/1999 07:13:14 PM SUNDAY 1 7
12/06/1999 07:13:14 PM MONDAY 2 1
12/07/1999 07:13:14 PM TUESDAY 3 2
12/08/1999 07:13:14 PM WEDNESDAY 4 3
12/09/1999 07:13:14 PM THURSDAY 5 4
12/10/1999 07:13:14 PM FRIDAY 6 5
12/11/1999 07:13:14 PM SATURDAY 7 6

Hope this helps,
Paul
Previous Topic: URGENT Syntax question.
Next Topic: Mutating table error
Goto Forum:
  


Current Time: Thu Mar 28 19:41:45 CDT 2024