I have a SQL statement using DISTINCT - see below - that is not working as we thought. The Distinct doesn't need to be on the "A.DEBITAMT, A.CRDTAMNT, A.DEBITAMT - A.CRDTAMNT AS NET" How do I write this statement that using DISTINCE on all other fields except the amount fields. Thank you!
SELECT DISTINCT A.OPENYEAR, A.TRXDATE, dbo.pdc_GetFiscalPeriod(A.TRXDATE) AS PERIODID, B.ACTNUMBR_1 AS DIVISION, B.ACTNUMBR_2 AS DEPARTMENT, B.ACTNUMBR_3 AS PROVIDER
, B.ACTNUMST, A.DEBITAMT, A.CRDTAMNT, A.DEBITAMT - A.CRDTAMNT AS NET