The fact that your table isn't properly normalized makes this far more
difficult than it need be.
You've got what's referred to as a repeating group. Rather than having
split1con, splitcon £, splitcon2 and splitcon £ as separate fields in a
single row, those should be two rows in a separate table. What are you going
to do if you need to split the job three ways instead of two?
You really should redesign your tables. In the meantime, though, you can
create a query that will mimic how the tables should actually be using a
Union query:
SELECT jobid, 1 AS WhichCase, split1con AS splitcon, [split1con £] AS
[splitcon£]
FROM MyTable
UNION
SELECT jobid, 2 AS WhichCase, split2con, [split2con £]
FROM MyTable
Now, it's a simple matter to create a query based on that query:
SELECT splitcon, Sum([splitcon£])
FROM MyQuery
GROUP BY splitcon
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
smason said:
hello i have a tbl that contains the following
jobid split1con splitcon £ splitcon2 splitcon £
11 john 300 bob 200
13 bob 200 john 100
i need the calculate all the values for i.e john in a total (in this case
400) how would i do this!