Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failed to open a rowset & Unknown Query Engine Error

Status
Not open for further replies.

mamartin

Programmer
Aug 10, 2001
75
US
I am receiving the following errors in a new Crystal Reports report: "Failed to open a rowset", then "Unknown Query Engine Error". The report is based upon a parameterized stored procedure. I am using CR 9.0 (sp4). If I create a report under CR 8.0 using this same SP, no problems. The stored procedure does contain a subquery at the very end to create summary numbers. Anybody know what the problem is? This is last bit of the SQL SP:

IF @num > 0
BEGIN

SELECT
pay_grade_cd,
order_by,
army_ind,
sum(SEQ) as SEQ, sum(BOQ) as BOQ,
isnull(@NRC_SEQ,0) as 'NRC_SEQ', isnull(@NRC_BOQ,0) as 'NRC_BOQ',
isnull(@VAC_SEQ,0) as 'VAC_SEQ', isnull(@VAC_BOQ,0) as 'VAC_BOQ',
isnull(@OCC_SEQ,0) as 'OCC_SEQ', isnull(@OCC_BOQ,0) as 'OCC_BOQ',
isnull(@CG_SEQ,0) as 'CG_SEQ', isnull(@CG_BOQ,0) as 'CG_BOQ',
isnull(@FM_SEQ,0) as 'FM_SEQ', isnull(@FM_BOQ,0) as 'FM_BOQ',
isnull(@CIV_SEQ,0) as 'CIV_SEQ', isnull(@CIV_BOQ,0) as 'CIV_BOQ',
isnull(@DIV_SEQ,0) as 'DIV_SEQ', isnull(@DIV_BOQ,0) as 'DIV_BOQ'
FROM
(
select
tmp.pay_grade_cd,
mp.stored_cd_id as order_by,
army_ind = case when tmp.service_branch_cd = 'AR' then 1 else 0 end,
SEQ = case tmp.current_occ_category_cd when 72180 then 1 else 0 end,
BOQ = case tmp.current_occ_category_cd when 72410 then 1 else 0 end
from #temp tmp
inner join dl_pay_grade dlpg on tmp.pay_grade_cd = dlpg.pay_grade_cd
inner join dl_military_pay_grade mp on dlpg.equivalent_pay_grade_cd = mp.description
where
tmp.Onpost_dwelling_assignment_id in
(select min(tmp2.Onpost_dwelling_assignment_id)
from #temp tmp2
group by tmp2.Onpost_dwelling_id) and
tmp.service_branch_cd in ('AR', 'AF', 'MC', 'NV') and
new_status_cd <> 'D'
) as bop_query
GROUP BY army_ind, pay_grade_cd, order_by
ORDER BY order_by desc

END
ELSE
BEGIN

SELECT
null as 'pay_grade_cd',
null as 'order_by',
null as 'army_ind',
null as 'SEQ',
null as 'BOQ',
isnull(@NRC_SEQ,0) as 'NRC_SEQ', isnull(@NRC_BOQ,0) as 'NRC_BOQ',
isnull(@VAC_SEQ,0) as 'VAC_SEQ', isnull(@VAC_BOQ,0) as 'VAC_BOQ',
isnull(@OCC_SEQ,0) as 'OCC_SEQ', isnull(@OCC_BOQ,0) as 'OCC_BOQ',
isnull(@CG_SEQ,0) as 'CG_SEQ', isnull(@CG_BOQ,0) as 'CG_BOQ',
isnull(@FM_SEQ,0) as 'FM_SEQ', isnull(@FM_BOQ,0) as 'FM_BOQ',
isnull(@CIV_SEQ,0) as 'CIV_SEQ', isnull(@CIV_BOQ,0) as 'CIV_BOQ',
isnull(@DIV_SEQ,0) as 'DIV_SEQ', isnull(@DIV_BOQ,0) as 'DIV_BOQ'
FROM
(select num = min(hsg_correspondence_id)
from housing_correspondence_default)
as bop_query
END

Thank you,
Michael A. Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top