I have a report that lists vendors and the accounts used to pay these vendors along with the total $ amount.
If you look at my screen shot you will see vendor "healthtrax international" for example. You will see there are multiple payments paid to this vendor from account 100101. We are a multi entity company, for example we have companies 101 and 120. How do I combine all those payments from account 100101 in to one total?
I want it to combine for both entities (company 101 and 120). So basically, I only want to have 1 line of account 100101 for this vendor. Ultimately I want to do this for for every vendor with every account.
To throw in a curve ball, we used those same accounts to pay other vendors, I want to keep each vendor separate. (as you can see above in my screenshot charles warner also uses 100101 but I DONT want to combine that total with healthtrax)
here is my code
SELECT dbo_APVENMAST.VENDOR_VNAME AS VENDOR_NAME, dbo_APVENMAST.VENDOR AS VENDOR_NUM, dbo_APVENMAST.VEN_CLASS, dbo_APDISTRIB.DIST_COMPANY, dbo_APDISTRIB.DIS_ACCT_UNIT AS ACCOUNTING_UNIT, dbo_GLNAMES.DESCRIPTION AS DEPT, dbo_APDISTRIB.ORIG_TRAN_AMT AS DOLLAR_AMT
FROM dbo_APVENMAST LEFT JOIN ((dbo_APDISTRIB LEFT JOIN dbo_GLMASTER ON (dbo_APDISTRIB.DIS_SUB_ACCT = dbo_GLMASTER.SUB_ACCOUNT) AND (dbo_APDISTRIB.DIS_ACCOUNT = dbo_GLMASTER.ACCOUNT) AND (dbo_APDISTRIB.DIS_ACCT_UNIT = dbo_GLMASTER.ACCT_UNIT) AND (dbo_APDISTRIB.DIST_COMPANY = dbo_GLMASTER.COMPANY)) LEFT JOIN dbo_GLNAMES ON (dbo_GLMASTER.ACCT_UNIT = dbo_GLNAMES.ACCT_UNIT) AND (dbo_GLMASTER.VAR_LEVELS = dbo_GLNAMES.VAR_LEVELS) AND (dbo_GLMASTER.COMPANY = dbo_GLNAMES.COMPANY)) ON dbo_APVENMAST.VENDOR = dbo_APDISTRIB.VENDOR
WHERE (((dbo_APVENMAST.VEN_CLASS)<>"EMP" And (dbo_APVENMAST.VEN_CLASS)<>"FRN" And (dbo_APVENMAST.VEN_CLASS)<>"ONE" And (dbo_APVENMAST.VEN_CLASS)<>"UTL") AND ((dbo_APVENMAST.CREATE_DATE)>=#4/1/2015# And (dbo_APVENMAST.CREATE_DATE)<=#12/1/2015#));