Multiple Rows

S

SD

I am working with a database that creates multiple rows for individual
orders based on having one record for each product ordered in each
order. I am trying to create a query which will give me the sum of
credit amounts grouped by credit types. Below is the SQL I am using:

SELECT credits.CREDIT_TYPE, Sum(credits.CREDIT_TAX) AS [Total Tax
Amount], Sum(credits.CREDIT_TOTAL) AS [Total Credit Amount]
FROM credits
WHERE (((credits.CREDIT_DATE) Between [StartDate] And [EndDate]))
GROUP BY credits.CREDIT_TYPE;

There is also a field - credits.ORDER_ID - which holds the value that
is duplicated.
I am looking for a suggestion of an expression to use to filter out the
duplicate rows (since the CREDIT_TAX and CREDIT_TOTAL amounts are the
same for each row with the same ORDER_ID.

Any suggestions would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top