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 |
|
mcordewener
Starting Member
19 Posts |
Posted - 2005-10-10 : 09:11:59
|
| Hi,I am trying to convert a MSAccess query to a stored procedure in SQL Server. And somehow the SQL server doesn't approve my iif statement what do I do wrong?CREATE PROCEDURE [dbo].[X450 - Delete Te Vroege Berichten] ASUPDATE tblCRM_All SET tblCRM_All.[04x] = IIf(tblCRM_All.[04x] < tblCRM_All.[01x], Null, [04x]), tblCRM_All.[08x] = IIf(tblCRM_All.[08x] < tblCRM_All.[01x],Null,[08x]), tblCRM_All.[09x] = IIf(tblCRM_All.[09x] < tblCRM_All.[01x],Null,[09x]), tblCRM_All.[150] = IIf(tblCRM_All.[150] < tblCRM_All.[01x],Null,[150]), tblCRM_All.[210] = IIf(tblCRM_All.[210] < tblCRM_All.[01x],Null,[210])From tblCRM_AlWHERE ((Not (tblCRM_All.[01x]) Is Null));GoGreetz,Marcel |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-10 : 09:15:42
|
| Replace IIf(tblCRM_All.[04x] < tblCRM_All.[01x], Null, [04x])byCase When tblCRM_All.[04x] < tblCRM_All.[01x] then Null else [04x] endMadhivananFailing to plan is Planning to fail |
 |
|
|
mcordewener
Starting Member
19 Posts |
Posted - 2005-10-10 : 09:23:58
|
Thx, it worksgreetz,Marcel Cordewenerquote: Originally posted by madhivanan Replace IIf(tblCRM_All.[04x] < tblCRM_All.[01x], Null, [04x])byCase When tblCRM_All.[04x] < tblCRM_All.[01x] then Null else [04x] endMadhivananFailing to plan is Planning to fail
|
 |
|
|
|
|
|
|
|