Display the long name of the day
Moderators: chulett, rschirm, roy
Display the long name of the day
Hi All,
I am facing a problem with the Date format . My source has a issue_dt column . I have to check the date whether its sunday or not. If its sunday I have to change the Edition_Cd to 14 else pass the same edition code from source.
How do I check whether the given date is sunday
I really appreciate your help
Thanks
rajeev
I am facing a problem with the Date format . My source has a issue_dt column . I have to check the date whether its sunday or not. If its sunday I have to change the Edition_Cd to 14 else pass the same edition code from source.
How do I check whether the given date is sunday
I really appreciate your help
Thanks
rajeev
-
- Participant
- Posts: 342
- Joined: Tue Nov 04, 2008 10:38 am
- Location: Chennai, India
I checked that but the values are not passing thru the target
I used the following :
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT,'SUNDAY')
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
Please help me.
Thanks
rajeev
I used the following :
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT,'SUNDAY')
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
Please help me.
Thanks
rajeev
-
- Participant
- Posts: 342
- Joined: Tue Nov 04, 2008 10:38 am
- Location: Chennai, India
Pass in the date and it will pass out the weekday number, 0 thru 6, where 0 = Sunday since sunday is the default 'origin day'. There is also a way to override the origin day if you want the week to start on a different day like Monday but I wouldn't worry about that in your case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I know that it gives the day number how to check that the given date is sunday . So I need to change the syntax as below
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) =0 And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
So is this way I should proceed
Please let me know.
Thanks
rajeev
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) =0 And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
So is this way I should proceed
Please let me know.
Thanks
rajeev
Hi chulett,
If I proceed the way I mentioned earlier . The data is not getting correctly into the target.
If its sunday then Edition_Cd=14 and Route_cd ='B:Route_Id'
Now , the data is loading in this way Way Edition_Cd=0 and Route_CD=B:Rout
Was there anything wrong in the syntax.
I really appreciate your help
Thanks
rajeev
If I proceed the way I mentioned earlier . The data is not getting correctly into the target.
If its sunday then Edition_Cd=14 and Route_cd ='B:Route_Id'
Now , the data is loading in this way Way Edition_Cd=0 and Route_CD=B:Rout
Was there anything wrong in the syntax.
I really appreciate your help
Thanks
rajeev
-
- Participant
- Posts: 342
- Joined: Tue Nov 04, 2008 10:38 am
- Location: Chennai, India
No the sunday is checked in the derivations against two columns
For Edition_Cd Column
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) is Sunday
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
For Route_cd Column:
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) is Sunday
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
Then 'B:To_New_isrt_trans.ROUTE_ID'
Else To_New_isrt_trans.ROUTE_ID
I tried your syntax chulett but still not working .
Kindly please help me out with this.
Thanks
rajeev
For Edition_Cd Column
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) is Sunday
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
then To_New_isrt_trans.EDITION_CODE='14'
else To_New_isrt_trans.EDITION_CODE
For Route_cd Column:
If WeekdayFromDate(To_New_isrt_trans.ISSUE_DT) is Sunday
And To_New_isrt_trans.EDITION_CODE='01'
And IsNotNull(To_New_isrt_trans.ROUTE_CD)
Then 'B:To_New_isrt_trans.ROUTE_ID'
Else To_New_isrt_trans.ROUTE_ID
I tried your syntax chulett but still not working .
Kindly please help me out with this.
Thanks
rajeev