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.
| 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] ASUPDATE tblOpenVerhuizingenEventInhuizenSET 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]+1WHERE(((tblOpenVerhuizingenEventInhuizen.id)=98)AND (([tblWatervalVerhuizen].[Categorie])>0)AND (([tblWatervalVerhuizen].[Type])='ZVIN') Or (([tblWatervalVerhuizen].[Type])='ZVIG')))GOHe 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 outMadhivananFailing to plan is Planning to fail |
 |
|
|
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 |
 |
|
|
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 -WHEREtblOpenVerhuizingenEventInhuizen.id=98AND [tblWatervalVerhuizen].[Categorie]>0AND ([tblWatervalVerhuizen].[Type])='ZVIN' Or [tblWatervalVerhuizen].[Type])='ZVIG') -------Moo. :) |
 |
|
|
|
|
|