on 08-11-2017 10:23 PM
I'm trying to create a formatted search, which includes the following snippet of code:
IF $[ORDR.CardCode] in (select cardcode from ocrd where groupcode = 256 and slpcode = 22) SELECT 'Text String'
When I trigger the FMS, I get the following error
Conversion Failed when converting the nvarchar value 'C12345' to data type int.
In this instance, CardCode translates to 'C12345'. I don't see why it is trying to convert the cardcode to data type int. I don't get an error when I run the code in SSMS (after replacing the field reference with the actual CardCode, of course).
The above snippet is just part of a larger FMS. Here is the entire code:
--Split Commission Rep
BEGIN
IF (SELECT MAX(T0.DiscPrcnt)
from RDR1 T0
inner join ORDR T1 on T1.DocEntry = T0.DocEntry
where T1.DocNum = $[ORDR.DocNum])>=70
SELECT 'Text 1'
ELSE
IF $[ORDR.CardCode] in (select cardcode from ocrd where groupcode = 256 and slpcode = 22)
SELECT 'Text 2'
ELSE SELECT '' END
The expected result is 'Text 1', 'Text 2' or blank. There error comes from the original code snippet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What is your expected result from above FMS?
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.