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

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle ODBC driver: How to get ISO week number from a date

Re: Oracle ODBC driver: How to get ISO week number from a date

From: sybrandb <sybrandb_at_gmail.com>
Date: 4 Oct 2006 02:15:35 -0700
Message-ID: <1159953335.920431.231750@m7g2000cwm.googlegroups.com>

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 DBA
Received on Wed Oct 04 2006 - 04:15:35 CDT

Original text of this message

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