on 03-05-2009 6:45 AM
Hi All,
I need to make a QPLD for GRPO. I have made a query but its getting list of all the GRPO's made in the system when i check i tried the query in SQL.
SELECT T0.[CardCode]'Cust Code', T0.[CardName]'Cust. Name' , T0.[DocNum]'Doc Number', T0.[DocDate] ,
T1.[ItemCode], T1.[Dscription]'Description', T1.[Quantity], T1.[Price], T2.[BuyUnitMsr],
T2.[SalUnitMsr],T1.[LineTotal] FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
Can this query be used for QPLD??
Thanks in advance,
Joseph
Hi Joseph,
Query generator help you a lot to write the sql queries to a level .
Just select the tables ,system will show the link between the tables if exist .
I suggest you to if u r new in sql just go for Crystal report for such reports , In rystal erport you vcan learn more of coding skills .
However the query is ok.
rgds,
Premraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A part of query is still missing!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you only need print one GRPO, you have to define condition. Such as:
SELECT T0.CardCode'Cust Code', T0.CardName'Cust. Name' , T0.DocNum 'Doc Number', T0.DocDate ,
T1.ItemCode, T1.Dscription'Description', T1.Quantity, T1.Price, T2.BuyUnitMsr,
T2.SalUnitMsr,T1.LineTotal FROM OPDN T0 INNER JOIN PDN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
WHERE T0.DocNum = '[%0\]'
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try this one:
SELECT T0.CardCode'Cust Code', T0.CardName'Cust. Name' , T0.DocNum 'Doc Number', T0.DocDate ,
T1.ItemCode, T1.Dscription'Description', T1.Quantity, T1.Price, T2.BuyUnitMsr,T1.Quantity * T2.NumInBuy 'Purchasing QTY', T2.SalUnitMsr, T1.Quantity * T2.NumInSale 'Sales QTY'
T1.LineTotal
FROM DBO.OPDN T0 INNER JOIN DBO.PDN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN DBO.OITM T2 ON T1.ItemCode = T2.ItemCode
WHERE T0.DocNum = '[%0\]'
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.