Searching By BP Properties
Is there any way to pull up BP Customers by Properties?
We would like to be able to select one or multiple properties and have a Query that pulls up the Customers that have these properties checked.
The Query should pull -
Acct #...Company Name...Total YTD Sales...Property
Gordon Du replied
Here you are:
SELECT T0.[CardCode] 'Acct #', T0.[CardName] 'Company Name', SUM(T1.[Debit] - T1.[Credit]) 'Total YTD Sales', T0.[QryGroup2] FROM OCRD T0, JDT1 T1 WHERE T0.[QryGroup2] = 'Y' and YEAR(T1.[RefDate]) = YEAR(GetDate()) and T0.[CardCode] = T1.[ShortName] AND T0.CardType = 'C' AND (T1.TransType = '13' OR T1.TransType = '14') GROUP BY T0.[CardCode], T0.[CardName], T0.[QryGroup2]
You can replace 2 with any other number to get the other property report.