Page 1 of 1

Date functions

Posted: Tue May 02, 2006 1:28 pm
by seanc217
Hi all,

I am looking for a way to calcuate the week of the month For example, 4/01/06 would calulate to week 1, while 4/8/06 would calculate to week 2.

Is there a function in DataStage to do this?

Thanks

Posted: Tue May 02, 2006 2:03 pm
by DSguru2B
You will need to code a custom routine to perform this task. Keep in mind the scenario what if the 1st April 2006 is a friday, will you still consider it as the first week or no?

Posted: Tue May 02, 2006 2:06 pm
by seanc217
I think since I am loading an Oracle table, that I can just use the to_char function to do it.

Thanks

Posted: Tue May 02, 2006 2:22 pm
by ray.wurlod
Curious to learn how TO_CHAR could return a week number. What are the business rules that define "week 1 in a month"? (For example read post from dsguru2b.)