cancel
Showing results for 
Search instead for 
Did you mean: 

Sales order

former_member186803
Participant
0 Kudos

Hello ,

In SAP B1 rdr1 table 'free text' field hold the original value of price , even if I change the value of price free text field holds the old value, I need to compare these two fields as not equal like

SELECT T0.[DocNum] FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[Price] <> T1.[FreeTxt]

to get all the sales order numbers where there was a price change.

But this gives me error as 'error converting nvarchar to numeric.

So pls help me to resolve this .

Rgds

Suman

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Error message due to two different format of fields.

Free text--->nVarChar

Unit price --->Numeric

Thanks & Regards,

Nagarajan

Answers (3)

Answers (3)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please close this thread by marking correct/helpful answer.

Thanks & Regards,

Nagarajan

Former Member
0 Kudos

Hi Suman,

To compare text with number is never a good idea even if you convert the text in the query.

That will be unreliable. It is better create a numeric UDF to store the price to compare with.

Thanks,

Gordon

former_member186803
Participant
0 Kudos

Thanks Gordon,

Yes you are right, even if I do convert it does not give correct result.

Thanks to all of you who has assisted me in this.

Regards

agustin_marcoscividanes
Active Contributor
0 Kudos

Hi

SELECT T0.[DocNum] FROM ORDR T0  INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE T1.[Price] <> cast (T1.[FreeTxt] as money)

Kind regards

Agustín Marcos Cividanes