on 08-15-2023 9:11 AM
I have this one sql query that i want to use it in Delivery Order item details column. Here is my code:
if (SELECT 1 FROM ORDR T0 <br>INNER JOIN RDR1 T1 ON T0.DocEntry=T0.DocEntry<br>WHERE isnull( T0.[U_Unit] ,0)>0 and T1.[ItemCode] =$[dln1.itemcode]) =1<br>SELECT <br>replace(<br>replace(<br>replace(<br>CAST(T1.[Text] AS NVARCHAR(2000))+CHAR(13) + CHAR(10)+CHAR(13) + CHAR(10)+'Total : <'+<br>cast(cast(round((T0.[U_unit]*$[dln1.quantity]) ,0) as decimal(12,0)) as nvarchar) +'> UNITS X <'+<br>cast(cast(round(($[dln1.quantity]) ,0) as decimal(12,0)) as nvarchar)+'> SETS'<br>,'<1>' ,concat('< ',round(cast(replace($[$38.11.1],',','') as decimal(12,0)),0),' >'))<br>,'<2>',concat('< ',cast(cast(round((2*cast($[dln1.quantity] as decimal(12,0))) ,0) as decimal(12,0)) as nvarchar) ,' >'))<br>,'<3>',concat('< ',cast(cast(round((3*cast($[dln1.quantity] as decimal(12,0))) ,0) as decimal(12,0)) as nvarchar) ,' >'))<br>FROM ORDR T0 <br>inner join RDR1 t1 on t0.docentry=t1.docentry<br>WHERE T1.[ItemCode]=$[dln1.itemcode]<br>else<br>select $[dln1.text]
but when i try it, from SO copy to DO, this error appears:
Can someone help me?
Your where conditions are not specific enough. At the moment they are returning all order lines with this specific item (subquery returned more than 1 value), which can be many. You need to rather work with BaseLine and BaseEntry to get the link to your SalesOrder.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.