Wednesday, March 7, 2012

Dont understand this error

Hello, I could use some help with this 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.

This if statement is the problem

IF (select bill_freq from #header1) = '1'
update #header1 Set
[Monthend] = aa.pername
from sv00564 zz inner join sv00532 aa on zz.wennsoft_period_id = aa.wennsoft_period_id
Where zz.rmdnumwk like #header1.Invoice_Number

The error means that select bill_freq from #header1 returns more than 1row. If there is more than one row in #header1, SQL doesn't knowwhich row to use.

No comments:

Post a Comment