Like this in mapping document :-- Populate with MPS.CHN_T1.CHN_STAT_DTE if T5_CUST_MERCH.MERCH_PRNT_CHN_NBR is not null and the Chains status code is closed (MPS.CHN_T1.MCT_STAT_COD = 'C'). Otherwise set to '99991231'
I have stag variable called svChnStatDate: - If IsNull(In_Amex_Chnt1_Demo.CHN_STAT_DTE) Then '99991231' Else TimestampToString(In_Amex_Chnt1_Demo.CHN_STAT_DTE,"%yyyy-%mm-%dd %hh:%nn:%ss")
I am trying to write a condition for this T5_CUST_MERCH.MERCH_PRNT_CHN_NBR is not null and the Chains status code is closed (MPS.CHN_T1.MCT_STAT_COD = 'C'). Otherwise set to '99991231'
like this
If IsNull(In_Amex_Chnt1_Demo.MERCH_PRNT_CHN_NBR) Then
Str('9999123') Else If (In_Amex_Chnt1_Demo.MCT_STAT_COD = 'C')
Then Str('9999123') Else svChnStatDate[1,4]:svChnStatDate[6,2]:svChnStatDate[9,2]
Please help me on this?
How to check the condition?
Moderators: chulett, rschirm, roy
I assume that the (In_Amex_Chnt1_Demo.CHN_STAT_DTE) field is of timestamp and your target field is of string type.
Try out this:
If (IsNotNull(In_Amex_Chnt1_Demo.MERCH_PRNT_CHN_NBR) And (In_Amex_Chnt1_Demo.MCT_STAT_COD = 'C') And IsNotNull(In_Amex_Chnt1_Demo.CHN_STAT_DTE) ) Then TimestampToString(In_Amex_Chnt1_Demo.CHN_STAT_DTE,"%yyyy-%mm-%dd %hh:%nn:%ss") Else '99991231'.
You need to be careful with your target column length. Here you are passing default vaue '99991231' of lengh 8 Or you are passing the converted timestamp of length 18.
Try out this:
If (IsNotNull(In_Amex_Chnt1_Demo.MERCH_PRNT_CHN_NBR) And (In_Amex_Chnt1_Demo.MCT_STAT_COD = 'C') And IsNotNull(In_Amex_Chnt1_Demo.CHN_STAT_DTE) ) Then TimestampToString(In_Amex_Chnt1_Demo.CHN_STAT_DTE,"%yyyy-%mm-%dd %hh:%nn:%ss") Else '99991231'.
You need to be careful with your target column length. Here you are passing default vaue '99991231' of lengh 8 Or you are passing the converted timestamp of length 18.
Ping me if I am wrong...
Re: How to check the condition?
reshma11 wrote:Like this in mapping document :-- Populate with MPS.CHN_T1.CHN_STAT_DTE if T5_CUST_MERCH.MERCH_PRNT_CHN_NBR is not null and the Chains status code is closed (MPS.CHN_T1.MCT_STAT_COD = 'C'). Otherwise set to '99991231'
I have stag variable called svChnStatDate: - If IsNull(In_Amex_Chnt1_Demo.CHN_STAT_DTE) Then '99991231' Else TimestampToString(In_Amex_Chnt1_Demo.CHN_STAT_DTE,"%yyyy-%mm-%dd %hh:%nn:%ss")
I am trying to write a condition for this T5_CUST_MERCH.MERCH_PRNT_CHN_NBR is not null and the Chains status code is closed (MPS.CHN_T1.MCT_STAT_COD = 'C'). Otherwise set to '99991231'
like this
If IsNull(In_Amex_Chnt1_Demo.MERCH_PRNT_CHN_NBR) Then
Str('9999123') Else If (In_Amex_Chnt1_Demo.MCT_STAT_COD = 'C')
Then Str('9999123') Else svChnStatDate[1,4]:svChnStatDate[6,2]:svChnStatDate[9,2]
Please help me on this?
Thanks for your reply.
Finally what I did is:
If (IsNotNull(In_Amex_Chnt1_Demo.MERCH_PRNT_CHN_NBR) And (In_Amex_Chnt1_Demo.MCT_STAT_COD = 'C') And IsNotNull(In_Amex_Chnt1_Demo.CHN_STAT_DTE) ) Then DateToString(TimestampToDate (In_Amex_Chnt1_Demo.CHN_STAT_DTE), "%yyyy%mm%dd") Else '99991231'