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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Internal SQL Server error - why?

Status
Not open for further replies.

morechocolate

Technical User
Apr 5, 2001
225
US
I am getting the following error after adding in the subquery.

The following are views
nyl_property_opstatmt
nyl_property_appr
nyl_loanxref



select distinct fl.loan_xref,sum(distinct isnull(po.noi,0)),
isnull((sum(distinct po.noi) * max(isnull(ex.nyl_part_per,100)))/100,0),
max(po.user_def_type)
from nyl_loanxref lx
inner join extgeneral ex on ex.loan = lx.loan
inner join loancoll lc on lc.loan = lx.loan
inner join fnUserDefType() fl on fl.loan_xref = lx.loan_xref
right outer join nyl_property_opstatmt po on po.prop_code = lc.code
where (count_type < 2 or
(po.user_def_type = 'actual' or
(lc.loan not in (select a.loan
from nyl_loanxref r
inner join fnUserDefType() d on r.loan_xref = d.loan_xref
right outer join nyl_property_appr a on a.loan = r.loan
right outer join nyl_property_opstatmt o on o.prop_code = a.prop_code
where o.user_def_type = 'actual' and
d.count_type > 1 and
lc.loan = a.loan and
d.loan_xref = fl.loan_xref and
po.prop_code = a.prop_code
))))
group by fl.loan_xref

 
I resolved this a different way. The problem must have been with using one of the views or the function in the subquery.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top