Home » Non-English Forums » French » determinate the number of a day
determinate the number of a day [message #126704] Wed, 06 July 2005 04:46 Go to next message
tjfromparis
Messages: 1
Registered: July 2005
Location: paris
Junior Member
[excuse me for my english so.... french]

How determinate the number of a day in a month.
Example : the second monday of a month


In french :
Je souhaite connaitre le numéro du jour dans un mois.
Par exemple : le deuxieme lundi du mois
j'imagine qu'il n'existe pas de fonction dejà faite dans oracle et qu'il est necessaire de la faire mais j'ai du mal à voir par ou commencer...




Merci.
Re: determinate the number of a day [message #126710 is a reply to message #126704] Wed, 06 July 2005 05:19 Go to previous message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
scott@ORA92> ALTER SESSION SET NLS_DATE_FORMAT = 'Day DD-Mon-YYYY'
  2  /

Session altered.

scott@ORA92> ALTER SESSION SET NLS_DATE_LANGUAGE = 'FRENCH'
  2  /

Session altered.

scott@ORA92> COLUMN "ultimo jour du mois precedente" FORMAT A30
scott@ORA92> SELECT SYSDATE		      AS "aujourd'hui",
  2  	    TRUNC (SYSDATE, 'MM')     AS "primo jour du mois",
  3  	    TRUNC (SYSDATE, 'MM') - 1 AS "ultimo jour du mois precedente"
  4  FROM   DUAL
  5  /

aujourd'hui          primo jour du mois   ultimo jour du mois precedente
-------------------- -------------------- ------------------------------
Mercredi 06-Jul-2005 Vendredi 01-Jul-2005 Jeudi    30-Jun-2005

scott@ORA92> SELECT NEXT_DAY (TRUNC (SYSDATE, 'MM') - 1, 'LUN')      AS "premier lundi",
  2  	    NEXT_DAY (TRUNC (SYSDATE, 'MM') - 1, 'LUN') + 7  AS "deuxième lundi",
  3  	    NEXT_DAY (TRUNC (SYSDATE, 'MM') - 1, 'LUN') + 14 AS "troisième lundi",
  4  	    NEXT_DAY (TRUNC (SYSDATE, 'MM') - 1, 'LUN') + 21 AS "quatrième lundi"
  5  FROM   DUAL
  6  /

premier lundi        deuxième lundi       troisième lundi      quatrième lundi
-------------------- -------------------- -------------------- --------------------
Lundi    04-Jul-2005 Lundi    11-Jul-2005 Lundi    18-Jul-2005 Lundi    25-Jul-2005

scott@ORA92> 



Previous Topic: ERROR: (SQA03)
Next Topic: urgent : french character to be refected on PDF
Goto Forum:
  


Current Time: Thu Mar 28 11:07:28 CDT 2024