Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting week of the date

Status
Not open for further replies.

indiantagore

Programmer
Dec 4, 2003
1
US

Hai ,

Can any body suggest me to calculate of week of the date in informatica. week of the date should be a number.

Thanks in advance
Tagore
 
either use a lookup to a calenderfile to fetch the weeknumber on a date, or calculate the weeknumber using the day of the year format like:
TO_DATE(DATE,'DDD')

This should fetch you an integer between 1 and 366 which you can recalculate to a weeknumber (with week 1 starting on the first day of the year)

T. Blom
Information analyst
tbl@shimano-eu.com
 
You have two options.. Either you can calculate Week Of Month or Week of Year.. If you have the Date port then in the Exp Trans add a port and put the expression as

TO_CHAR(DATE_ID,'W') for WeekOfMonth
TO_CHAR(DATE_ID,'WW') for WeekOfYear.

Sri
 
Yes, of course that is the best option. Confusing is that the weekcalculation is indeed offered with TO_CHAR and not with TO_DATE.

Good correction , Sri

T. Blom
Information analyst
tbl@shimano-eu.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top