A
Alastair MacFarlane
Dear All,
If I run the following query on this table, where [JobNo] (Text),
[FeeAmount] (Currency), [Posted] (True/False):
JobNo, FeeAmount, Posted
22, £0.00 , No
4, £55.00, Yes
4, £101.00, Yes
4, £0.00, No
With the following SQL:
SELECT JobNo, Posted, Sum(test.FeeAmount) AS FeeAmount
FROM test
GROUP BY JobNo, Posted;
results in:
JobNo, Posted, FeeAmount
22, £0.00, Yes
4, Yes, £156.00
.... but what I want is:
JobNo, FeeAmount, Posted
22, £0.00, No
4, £156.00, Yes
4, £0.00, No
I wrongly presumed that it would group by the JobNo and by the Posted and
then give me a total for each and if there was only Yes then it would only
give the total of Yes.
What am I doing wrong?
Thanks again...
Alastair MacFarlane
If I run the following query on this table, where [JobNo] (Text),
[FeeAmount] (Currency), [Posted] (True/False):
JobNo, FeeAmount, Posted
22, £0.00 , No
4, £55.00, Yes
4, £101.00, Yes
4, £0.00, No
With the following SQL:
SELECT JobNo, Posted, Sum(test.FeeAmount) AS FeeAmount
FROM test
GROUP BY JobNo, Posted;
results in:
JobNo, Posted, FeeAmount
22, £0.00, Yes
4, Yes, £156.00
.... but what I want is:
JobNo, FeeAmount, Posted
22, £0.00, No
4, £156.00, Yes
4, £0.00, No
I wrongly presumed that it would group by the JobNo and by the Posted and
then give me a total for each and if there was only Yes then it would only
give the total of Yes.
What am I doing wrong?
Thanks again...
Alastair MacFarlane