I wrote the following query wanting the results to be one row with a sum for column1 and column2 as the fields. However,
I'm getting 20 records results with a sum by the field ledgertrans.accountnum.
Appreciate some assistance with getting the desired result.
Thank you,
Andrew
++++++++++++++++++++++++++
select
(select sum(ledgertrans.amountcur)
where ledgertrans.accountnum in
('41010','41011','42010','42020','42030','42080','42310'))
as [Column 1],
(select sum(ledgertrans.amountcur)
where ledgertrans.accountnum in
('51010','51015','51020','51030','52010','52020','52050','52051','53020','53030','53040','53050','53090'))
as [Column 2]
from ledgertrans
where ledgertrans.transdate = '2009-11-02'
and ledgertrans.dimension = 'ws'
group by ledgertrans.accountnum
I'm getting 20 records results with a sum by the field ledgertrans.accountnum.
Appreciate some assistance with getting the desired result.
Thank you,
Andrew
++++++++++++++++++++++++++
select
(select sum(ledgertrans.amountcur)
where ledgertrans.accountnum in
('41010','41011','42010','42020','42030','42080','42310'))
as [Column 1],
(select sum(ledgertrans.amountcur)
where ledgertrans.accountnum in
('51010','51015','51020','51030','52010','52020','52050','52051','53020','53030','53040','53050','53090'))
as [Column 2]
from ledgertrans
where ledgertrans.transdate = '2009-11-02'
and ledgertrans.dimension = 'ws'
group by ledgertrans.accountnum