cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Location

former_member645084
Participant
0 Kudos

Hi

IN below query i want to that List of Locations from Olct should be displayed for Selection. User should be able to select more than 1 Location. Also with Date From & Date To option.

SELECT M.DocEntry, M.DocNum AS 'AR Inv. #', M.DocDate as 'Date', M.CardName as 'Customer Name'
FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
LEFT JOIN CRD1 A on M.CardCode=A.CardCode and M.PayToCode=A.Address and A.AdresType='S'
WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Check this if helps:

SELECT M.DocEntry, M.DocNum AS 'AR Inv. #', M.DocDate as 'Date', M.CardName as 'Customer Name', L.LocCode as 'AreaLoc' FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN OLCT k ON k.Code = L.LocCode LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry LEFT JOIN CRD1 A on M.CardCode=A.CardCode and M.PayToCode=A.Address and A.AdresType='S' WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') GROUP BY M.DocEntry, M.DocNum , M.DocDate, M.CardName, L.LocCode HAVING L.LocCode in ( '[%2]','[%3]','[%4]','[%5]')

regards,

Jitin