scottomlinson
New Member
- Joined
- Aug 26, 2010
- Messages
- 8
Each month we need to calculate rebates to certain customers. Currently this is done by hand by running a report, keying the values into a spreadsheet that has blank cells for data entry and calculation cells.
I can pull the transactional detail from the database using MS Query via ODBC. The data looks like this:
A B C D E F G H I
1 date invnum cust qty price cost extprice extcost prftamt
2 3/1/11 515784 123 1512 3.068 3.063 4638.82 4631.26 7.56
3 3/1/11 515784 123 7434 2.832 2.827 21053.09 21015.92 37.17
4 3/1/11 515806 155 1512 3.068 3.063 4638.82 4631.26 7.56
5 3/1/11 515806 155 4810 2.832 2.827 13621.92 13597.87 24.05
We have a tab for each customer. On Customer 123's tab the result we are looking for is:
A B C D E F G
1 Date Invnum Amt Profit Cost Basis Rebate
2 3/1/11 515784 25691.90 44.72 25647.18 256.47 128.24
3
4
5
I want 1 row for each invoice number (B-Invnum), invoice date (A-Date) with the sum of extended price (C-Amt), sum of extended cost (E-Cost). The other columns are calculations.
How do I retrieve those single summed rows from the data? There could be 1, 2, 3 or 4 lines for a given invoice number.
thanks in advance!
I can pull the transactional detail from the database using MS Query via ODBC. The data looks like this:
A B C D E F G H I
1 date invnum cust qty price cost extprice extcost prftamt
2 3/1/11 515784 123 1512 3.068 3.063 4638.82 4631.26 7.56
3 3/1/11 515784 123 7434 2.832 2.827 21053.09 21015.92 37.17
4 3/1/11 515806 155 1512 3.068 3.063 4638.82 4631.26 7.56
5 3/1/11 515806 155 4810 2.832 2.827 13621.92 13597.87 24.05
We have a tab for each customer. On Customer 123's tab the result we are looking for is:
A B C D E F G
1 Date Invnum Amt Profit Cost Basis Rebate
2 3/1/11 515784 25691.90 44.72 25647.18 256.47 128.24
3
4
5
I want 1 row for each invoice number (B-Invnum), invoice date (A-Date) with the sum of extended price (C-Amt), sum of extended cost (E-Cost). The other columns are calculations.
How do I retrieve those single summed rows from the data? There could be 1, 2, 3 or 4 lines for a given invoice number.
thanks in advance!