Link to home
Start Free TrialLog in
Avatar of rgn2121
rgn2121Flag for United States of America

asked on

Difference between Oracle's date formatted as "ww" and Access' formatted as "ww"?

I have a query in which I convert a date to it's week of the year "ww".  When I am writting the code to run directly on the Oracle Tables I use:

To_Char(To_Date("Some_Date",'MM/DD/YYYY'),'WW') as WkOfYear

In Access I am doing this:
Format(qryTemp_Data!Some_Date,"ww") AS WkOfYear

What I have found is that for the 4th of February, Oracle says it is the 5th week, but Access says it is the 6th.  I know that the 5th of February would actually be the true 6th week, and Oracle changes to the 6th week on that day, but I am curious what each looks at and is there a way to make it so that the full "Work Week" is the same in Oracle and not split up?
ASKER CERTIFIED SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgn2121

ASKER

I tried this and it is giving me an error...ORA-01858 - Non Numeric Character
To_Char(To_Date("Some_Date",'yyyymmdd'),'lw') as FLT_WEEK

Some date is one of the fields of an inner query....
Avatar of rgn2121

ASKER

Okay...it was an " i " and not an " L "...That was the issue...  Thanks
Avatar of rgn2121

ASKER

I gave most of the points to sujith80 since he had the right solution, I just couldn't tell if it was an " i " or an " L ".  Thanks to both!