Skip to Content
0
Former Member
Mar 03, 2011 at 08:11 AM

Fixed Asset Query Correction

60 Views

Dear Experts,

I have created the below query for the Fixed Asset Register. But in the last column 'Ordinary' i cannot join the subquery with the main query query I keep getting error message:

"Subquery returned more than 1 value. This is not permitted when the subquery follows =,!=,<,<=,>,>= or when the subquery is used as an expression."

Please correct the query and if possible explain the answer.

I'll be gratefull

SELECT DISTINCT T0.U_AsstNum, T0.U_AcqDate, T0.U_Desc, T1.U_DprDate, T1.U_DprTypID, T2.U_APC, T2.U_OrDpAcc, T3.U_Price AS 'Acquisition',

+(SELECT T4.[U_OrDpPlan] FROM [dbo].[@BA_ODPVN] T4 WHERE T4.U_AsstNum = T1.U_AsstNum) AS 'Ordinary Depreciation'+

FROM

[dbo].[@BA_OAMD] T0 INNER JOIN [dbo].[@BA_OAMD2]

T1 ON T0.U_AsstNum = T1.U_AsstNum LEFT JOIN [dbo].[@BA_OAMD3] T2

ON T0.U_AsstNum = T2.U_AsstNum AND T1.U_AsstNum = T2.U_AsstNum LEFT JOIN [dbo].[@BA_ODOC2]T3

ON T0.U_AsstNum = T3.U_Account AND T1.U_AsstNum = T3.U_Account AND T2.U_AsstNum = T3.U_Account