mrpauly
Programmer
- May 11, 2001
- 23
Hello,
I'm trying to run the SQL union query and would like to have this merged into one record...Right now, the results are displayed into two records.
Eventually, I will be removing the Customer Number where clause to run against all customers.
Thanks,
Paul
select
t1.ShipNum as CustNum,
Count(*) as Shipments,
Sum(t1.Rev) as Revenue,
Sum(t1.AdjCost) as AdjCost
from
tblRawAccess as t1
where
t1.ShipNum = 'KKL2712SKM' and
t1.FbType = 'P' and
t1.Month = '0306'
group by
t1.ShipNum
union
select
t1.CsgnNum as CustNum,
Count(*) as Shipments,
Sum(t1.Rev) as Revenue,
Sum(t1.AdjCost) as AdjCost
from
tblRawAccess as t1
where
t1.CsgnNum = 'KKL2712SKM' and
t1.FbType = 'C' and
t1.Month = '0306'
group by
t1.CsgnNum
I'm trying to run the SQL union query and would like to have this merged into one record...Right now, the results are displayed into two records.
Eventually, I will be removing the Customer Number where clause to run against all customers.
Thanks,
Paul
select
t1.ShipNum as CustNum,
Count(*) as Shipments,
Sum(t1.Rev) as Revenue,
Sum(t1.AdjCost) as AdjCost
from
tblRawAccess as t1
where
t1.ShipNum = 'KKL2712SKM' and
t1.FbType = 'P' and
t1.Month = '0306'
group by
t1.ShipNum
union
select
t1.CsgnNum as CustNum,
Count(*) as Shipments,
Sum(t1.Rev) as Revenue,
Sum(t1.AdjCost) as AdjCost
from
tblRawAccess as t1
where
t1.CsgnNum = 'KKL2712SKM' and
t1.FbType = 'C' and
t1.Month = '0306'
group by
t1.CsgnNum