Skip to Content
0
Former Member
Jun 25, 2009 at 01:08 PM

SUMMARY QUERY

43 Views

I am running the following query to show me all documents tied to a Master Project so that I can see the P&L implications.

SELECT T1.DocNum AS 'Inv #', T1.DocDate, T1.CardCode AS 'Customer #', T1.CardName AS 'Customer', T1.U_ISGI_pono AS 'MP #', T1.U_ISGI_prjd,T1.U_ISGI_type, T0.ItemCode, T0.Quantity, T0.LineTotal, T0.PriceBefDi

FROM DBO.OINV T1

LEFT JOIN DBO.INV1 T0 ON T1.DocEntry = T0.DocEntry and (T0.ItemCode NOT IN ('a9999','c9999','i1026', 'i1027', 'i1028', 'i1029', 'i1032', 'i1122', 'i1143', 'i1501', 'i1620', 'i1900', 'i9997', 'Z_Freight') OR (T0.ItemCode is NULL))

WHERE (T1.U_ISGI_pono Like '%[%2]%') and T1.DocEntry=T0.DocEntry and (T0.LineTotal is Not NULL)

Order By T0.ItemCode

The query works perfectly but want I want to ask is there a way to condense all of the transactional information so that I can prepare a Query to only give me the total information on one line for multiple Master Projects over a set period of time? If anyone has insight on how to do this I would be appreciative.