SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 dont understand this error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gogetsome
Starting Member

10 Posts

Posted - 10/18/2005 :  16:17:02  Show Profile  Reply with Quote
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 causing the problem. Any help would be great!

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

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 10/18/2005 :  16:19:08  Show Profile  Visit tkizer's Homepage  Reply with Quote
You have more than one bill_freq that equals 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 AND bill_freq = '1'

Tara
Go to Top of Page

gogetsome
Starting Member

10 Posts

Posted - 10/18/2005 :  16:31:33  Show Profile  Reply with Quote
Yes, that should be correct. I need to be able to update all the fields that contain '1' to the value of aa.pername. How can the if statement be modified to do that?
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 10/18/2005 :  16:39:27  Show Profile  Visit tkizer's Homepage  Reply with Quote
How many columns?

Tara
Go to Top of Page

gogetsome
Starting Member

10 Posts

Posted - 10/18/2005 :  16:41:10  Show Profile  Reply with Quote
Thanks so much for helping.

Just one column [monthend]
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36941 Posts

Posted - 10/18/2005 :  16:47:06  Show Profile  Visit tkizer's Homepage  Reply with Quote
The update statement that I posted already does this.

Tara
Go to Top of Page

gogetsome
Starting Member

10 Posts

Posted - 10/18/2005 :  16:58:33  Show Profile  Reply with Quote
oops, sorry I didn't see the change. Thanks for hleping.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000