Skip to content
Advertisement

ORACLE CONVERT CHAR FORMAT “YYYY-WW” TO DATE FORMAT

I am trying to convert char date format “YYYY-WW” in ORACLE to date for calculating by week in year but have a trouble with error message format code cannot appear in date input format

If i write

It will be normal

But if i write

The message error format code cannot appear in date input format appear. I don’t have no idea how to convert it right

Thanks for any advice

Advertisement

Answer

You can use:

For your code:


If you want to use ISO weeks (which always start on a Monday, rather than counting from the 1st January as WW does) then:

db<>fiddle here

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement