cancel
Showing results for 
Search instead for 
Did you mean: 

Error While running Query in SAP B1

Former Member
0 Kudos

Hi All,

I am creating one Q-PLD so i have to run the following query. Query is working fine in SQL Server

But while running with SAP B1 showing error 'Cant convert into varchar to small int'

Query is

Select (select M1.[GroupName] from OCRG M1 where M1.[GroupCode] = T2.[GroupCode]) As 'State', 
T0.[CardCode] AS 'Customer Code',T0.[CardName] AS 'Customer Name',T4.[U_SchNo] As 'Scheme Ref No',
T1.[U_Itmgrp] AS 'Item Group',T1.[U_TAdvAmt] AS 'Actual Adv',T0.[DocDate] As 'Doc Date',
T0.[DocNum] AS 'Invoice No.',T1.[U_QtyKgs] AS 'Qty In KG',T1.[U_CAdvRate] AS 'Advance Rate',
T1.[U_DedAdvA] AS 'Actual Adv. Adj.',T1.[U_BalAdvA]- T1.[U_DedAdvA] As 'Balance'
from [dbo].[OINV] T0  INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry = T1.DocEntry 
INNER JOIN [dbo].[OCRD] T2 ON T0.CardCode = T2.CardCode 
INNER JOIN [dbo].[OCRG] T3 ON T2.GroupCode = T3.GroupCode
LEFT OUTER JOIN [dbo].[@CUSTAMT] T4 ON T0.[CardCode] = T4.[U_Custcode] 
And T1.[U_Itmgrp] = T4.[U_Itemgrp]
Where T0.[DocDate] between '[%0]' And '[%1]' And 
T0.[CardCode] between '[%2]' And '[%3]'
And T1.[U_Itmgrp]  between '[%4]'  And '[%5]'   ' This line i am getting error 
     ' If i this line will remove error will disappear or i will pass parameter directly like 'ItemGrop1'
And T3.[GroupName] between '[%6]' And '[%7]'

By

Firos C

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You have posted more than one threads on various forums. Please stick on this one in the future if it relates to report.

Thanks,

Gordon

Former Member
0 Kudos

Hi gordon,

I posted bcz this is related with all type of group. I thought like where i will get exact sln.

I will close other. I will keep SDK

Former Member
0 Kudos

Actually, here is the right forum for this question and query.