| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> sql date function
Try using this :
to_char(to_date('2000-04-07', 'YYYY-MM-DD'), 'IW') which gives '14' as a string !
If you need it as a number, wrap it in to_number() as well.
to_number(to_char(to_date('2000-04-07', 'YYYY-MM-DD'), 'IW')) which gives 14.
If you want the week number within the month (1 to 5) , drop the 'I'.
to_number(to_char(to_date('2000-04-07', 'YYYY-MM-DD'), 'W')) which gives 1.
HTH
Regards,
Norman.
Tel: 0113 289 6265 Fax: 0113 289 3146 URL: http://www.Lynx-FS.com
-------------------------------------
-----Original Message-----
From: Maros Kollar [mailto:spam_at_k-1.com]
Posted At: Friday, November 22, 2002 10:57 AM
Posted To: server
Conversation: sql date function
Subject: sql date function
hi,
i need a sql command to convert a date (unix timestamp, or other fomrat
like
yyyy-mm-dd) into a weeknum
i'm using oracle 8i
regards
maros
Received on Fri Nov 22 2002 - 05:27:23 CST
![]() |
![]() |