infomania
Programmer
- Oct 27, 2002
- 148
Using SQL Server 2000 with JDEdwards OneWorld
I keep getting the following error message when I try to run a union query:
Server: Msg 21, Level 20, State 1, Line 5
Warning: Fatal error 1203 occurred at Jun 17 2003 11:00PM
Connection Broken
The indiviual select statements run OK and two in combination but adding the third caused the error. Below is the query. Any ideas to solve this?
select
abac11
, sales=0
, cost=0
, profit=0
, orders=0
, pysales=0
, plansales=0
, sum(sduorg*sduprc)/10000 bkLogAmt
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdtrdj>103001
and sddrqj<=103181
and sdivd=0
and sddcto='SO' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''
union
select
abac11
, sales=sum(sdaexp)/100
, cost=sum(sdecst)/100
, profit=sum(sdaexp-sdecst)/100
, orders=count(distinct(sddoco))
, pysales=0
, plansales=0
, bkLogAmt=0
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdivd>=103152 and sdivd<=103168
and sddct='ri' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''
union
select
abac11
, sales=0
, cost=0
, profit=0
, orders=0
, pysales=sum(sdaexp)/100
, plansales=0
, bkLogAmt=0
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdivd>=103152 and sdivd<=103168
and sddct='ri' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''
I keep getting the following error message when I try to run a union query:
Server: Msg 21, Level 20, State 1, Line 5
Warning: Fatal error 1203 occurred at Jun 17 2003 11:00PM
Connection Broken
The indiviual select statements run OK and two in combination but adding the third caused the error. Below is the query. Any ideas to solve this?
select
abac11
, sales=0
, cost=0
, profit=0
, orders=0
, pysales=0
, plansales=0
, sum(sduorg*sduprc)/10000 bkLogAmt
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdtrdj>103001
and sddrqj<=103181
and sdivd=0
and sddcto='SO' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''
union
select
abac11
, sales=sum(sdaexp)/100
, cost=sum(sdecst)/100
, profit=sum(sdaexp-sdecst)/100
, orders=count(distinct(sddoco))
, pysales=0
, plansales=0
, bkLogAmt=0
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdivd>=103152 and sdivd<=103168
and sddct='ri' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''
union
select
abac11
, sales=0
, cost=0
, profit=0
, orders=0
, pysales=sum(sdaexp)/100
, plansales=0
, bkLogAmt=0
from proddta.f4211 sd
left join proddta.f0101 ab
on sdan8=aban8
where
abac11 not in ('MG','CH')
and sdivd>=103152 and sdivd<=103168
and sddct='ri' and sdsocn=0 and sdktln=0
and sdlnty not in ('f','m','rs')
group by
abac11
having abac11!=''