Page 2 of 2

Posted: Mon Oct 22, 2007 4:37 am
by stefanfrost1
in your example the negation mark (-) is at the end of the string. Try flipping it to the front of the string, or just remove it and add if after conversion via a mathematical function

String(NVarChar) to Decimal(Numeric) conversion successful

Posted: Tue Oct 23, 2007 5:46 am
by Mukti
stefanfrost1 wrote:in your example the negation mark (-) is at the end of the string. Try flipping it to the front of the string, or just remove it and add if after conversion via a mathematical function
Hi Stefan

Thanks for your suggestion. I worked on that and got the solution.
I have used some transformation for converting that column value from string more specifically from NVarChar to Decimal. Now proper data is loading including negative values.

Below is the code:

If Index(TrimLeadingTrailing(ext_s_e_b_item.SYSTEM_CALCULATED_OPENING_BALANCE) ,"-",1) >0 Then StringToDecimal("-" : (Trim(Trim(ext_s_e_b_item.SYSTEM_CALCULATED_OPENING_BALANCE,"-","T") ,"0","L")))Else StringToDecimal(Trim(ext_s_e_b_item.SYSTEM_CALCULATED_OPENING_BALANCE,"0","L"))