Skip to Content
J S

Multiple Location

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 23, 2020 at 02:41 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.