Hi,
I have a table full of payments which are all uniqe. I want to be able to run a query that will return the sum of two values in a number of records with the same value in a paticular field.
So: the table payments has the following fields:
PaymentID (autonumber and primary key)
Subtotal
VAT
Total Payable
Budget code
So if i had three records, 1,2 and 3 and record 1 and 3 had the same value for the Budget code i'd want to return the sum of Subtotal, VAT and Total Payable for records 1 and 3 in one row and the same valus but for record 2 as another record.
Is there a way of doing this in an SQL query? If not, can you suggest another approach.
Cheers
I have a table full of payments which are all uniqe. I want to be able to run a query that will return the sum of two values in a number of records with the same value in a paticular field.
So: the table payments has the following fields:
PaymentID (autonumber and primary key)
Subtotal
VAT
Total Payable
Budget code
So if i had three records, 1,2 and 3 and record 1 and 3 had the same value for the Budget code i'd want to return the sum of Subtotal, VAT and Total Payable for records 1 and 3 in one row and the same valus but for record 2 as another record.
Is there a way of doing this in an SQL query? If not, can you suggest another approach.
Cheers