Link to home
Create AccountLog in
Avatar of Keith Westberg
Keith Westberg

asked on

Converting a Datepart query to Oracle pl/sql

Ive found many many examples of Datepart conversions which are all simple if you use only the standard version which is:

DataPart("WW", DateValue)

But my issue is with the FirstDayOfWeek optional parameter that DatePart uses.  I need to convert a DatePart line that looks like:

DatePart("WW", DateValue, 3)

The 3 is an optional value that allows you to choose what the first day of the week is based on.  In this case 3 stands for Tuesday.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Keith Westberg
Keith Westberg

ASKER

Got it... im sure it may have flaws somewhere but for its purpose it is returning the expectd result.

to_number(to_char(trunc(sysdate) + 2, 'IW'))

Cheers
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.