on 01-28-2015 10:09 AM
Hi Experts,
Good day!
Can someone help me in the below query? I am generating a report for the list of Deliveries with their corresponding invoice # and item details from delivery. Unfortunately I can generate any details.
Kindly see my query below:
SELECT T0.[DocDate], T0.[DocNum], T2.[DocDate], T0.[CardName], T1.[Quantity], T1.[ItemCode], T1.[Dscription],T3.[SlpName] FROM ODLN T0 INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry], OINV T2 INNER JOIN OSLP T3 ON T0.[SlpCode] = T3.[SlpCode] WHERE WHERE T0.DocDate between [%0] and [%1]
Below are the details that I want to show in the report.
Thanks!
Ashley
Hi,
Try this:
SELECT T0.[DocDate], T0.[DocNum], T2.[DocDate], T0.[CardName], T1.[Quantity], T1.[ItemCode],
T1.[Dscription],T1.[Price],T3.[SlpName]
FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN INV1 T4 ON T4.BaseEntry = T1.DocEntry AND T4.BaseLine = T1.LineNum
INNER JOIN OINV T2 ON T2.DocEntry = T4.DocEntry
INNER JOIN OSLP T3 ON T0.[SlpCode] = T3.[SlpCode]
WHERE T0.DocDate between [%0] and [%1]
GROUP BY T0.[DocDate], T0.[DocNum], T2.[DocDate], T0.[CardName], T1.[Quantity], T1.[ItemCode],
T1.[Dscription],T3.[SlpName],T1.[Price]
Thanks & Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leigh,
Please check below Query.
SELECT T0.[DocDate], T0.[DocNum], T2.[DocDate], T0.[CardName], T1.[Quantity], T1.[ItemCode],
T1.[Dscription],T3.[SlpName] FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN INV1 T4 ON T4.BaseEntry = T1.DocEntry AND T4.BaseLine = T1.LineNum
INNER JOIN OINV T2 ON T2.DocEntry = T4.DocEntry
INNER JOIN OSLP T3 ON T0.[SlpCode] = T3.[SlpCode]
WHERE T0.DocDate between [%0] and [%1]
GROUP BY T0.[DocDate], T0.[DocNum], T2.[DocDate], T0.[CardName], T1.[Quantity], T1.[ItemCode],
T1.[Dscription],T3.[SlpName]
Hope this helps
--
--
Regards::::
Atul Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this
SELECT DISTINCT A.DocDate, A.[DocNum], D.DocNum, A.[CardName],b.ItemCode,b.Dscription,b.Quantity,b.Price,G.SlpName
FROM ODLN A
INNER JOIN DLN1 B ON A.DocEntry=B.DocEntry
LEFT OUTER JOIN INV1 C ON C.BaseRef=B.TrgetEntry AND C.BaseType=A.ObjType AND B.ItemCode=C.ItemCode
INNER JOIN OINV D ON C.DOCENTRY=D.DOCENTRY
inner join OCRD F ON F.CARDCODE=A.CARDCODE
INNER JOIN OSLP G ON G.SlpCode=F.SlpCode
GROUP BY
A.DocDate, A.[DocNum], D.DocNum, A.[CardName],b.ItemCode,b.Dscription,b.Quantity,b.Price,G.SlpName
ORDER BY A.[DocNum], D.DocNum
--Manish
User | Count |
---|---|
103 | |
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.