Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle ODBC driver: How to get ISO week number from a date
Wolfram Roesler wrote:
> Hello,
>
> I'm using the Oracle ODBC driver to get the week number from
> a DATE column:
>
> SELECT {fn week(ColumnName)} from TableName;
>
> Unfortunately, the ODBC driver translates this into:
>
> SELECT to_char(ColumnName,'WW') from TableName;
>
> which returns the week number relative to the first day of the
> year, I need the ISO week number instead however. In Oracle, I
> can get this with
>
> SELECT to_char(ColumnName,'IW') from TableName;
>
> but is it possible to get the ISO week number (and corresponding year,
> i. e. what Oracle returns with 'IYYY') via an ODBC function?
>
> Thanks for any help
> W. Roesler
I don't think IW and IYYY are standard SQL. Consequently, ODBC doesn't
support that.
You'll need a passthru query.
-- Sybrand Bakker Senior Oracle DBAReceived on Wed Oct 04 2006 - 04:15:35 CDT
![]() |
![]() |