Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 no joins

Author  Topic 

PetervO
Starting Member

2 Posts

Posted - 2005-11-10 : 04:12:10
Hi who can help me figgering out what's wrong with the following code:
CREATE PROCEDURE DBO.[612 - Update Aantal totaal Inhuizingen]
AS
UPDATE tblOpenVerhuizingenEventInhuizen
SET
tblOpenVerhuizingenEventInhuizen.BinnenNorm = Case When [tblWatervalVerhuizen].[Norm]='1' Then [BinnenNorm]+1 Else [BinnenNorm] End,
tblOpenVerhuizingenEventInhuizen.OranjeNorm = Case When [tblWatervalVerhuizen].[Norm]='2' Then [OranjeNorm]+1 Else [OranjeNorm] End,
tblOpenVerhuizingenEventInhuizen.BuitenNorm = Case When [tblWatervalVerhuizen].[Norm]='3' Then [BuitenNorm]+1 Else [BuitenNorm] End,
tblOpenVerhuizingenEventInhuizen.Totaal = [Totaal]+1

WHERE
(((tblOpenVerhuizingenEventInhuizen.id)=98)

AND

(([tblWatervalVerhuizen].[Categorie])>0)

AND

(([tblWatervalVerhuizen].[Type])='ZVIN') Or (([tblWatervalVerhuizen].[Type])='ZVIG')))
GO

He gives an error on the ')' but I think they are correct, if you take 1 away he gives an error that he doesn't know tblWatervalVerhuizen......THX!!!!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-10 : 04:24:40
Double click the error message and see where it is pointing out

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

PetervO
Starting Member

2 Posts

Posted - 2005-11-10 : 04:54:32
thx for your reply but it's no real help I'm afraid
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2005-11-10 : 05:15:22
Why have you got all those brackets in there anyway? You don't need most of them. What condition are you trying to OR? If it's the last one then this should suffice -


WHERE
tblOpenVerhuizingenEventInhuizen.id=98

AND

[tblWatervalVerhuizen].[Categorie]>0

AND

([tblWatervalVerhuizen].[Type])='ZVIN' Or [tblWatervalVerhuizen].[Type])='ZVIG')



-------
Moo. :)
Go to Top of Page
   

- Advertisement -