WHERE portion of Update statement not working (1 Viewer)

proballin

Registered User.
Local time
Today, 13:42
Joined
Feb 18, 2008
Messages
105
I have 3 consecutive update statements that have the following in each respective WHERE section:

(MkFrmFunc_Table.Function1 <> "")And(MkFrmFunc_Table.Function2 <> "")
(MkFrmFunc_Table.Function1 = "")And(MkFrmFunc_Table.Function2 <> "")
(MkFrmFunc_Table.Function1 <> "")And(MkFrmFunc_Table.Function2 = "")

Function1 and Function2 are strings that should only be update based on one of the three update statements with the WHERE clauses written above.

But for some reason the only update occurs is based on which ever is listed last. So for the example above, all Function1, whether there is a string there or not, is updated. If I put the first update statement (the one with (MkFrmFunc_Table.Function1 <> "")And(MkFrmFunc_Table.Function2 <> "") in its update section) last, then all Function1 and Function2 are updated. Its like the program is ignoring the where portion of the updates except for which ever is the last one written. Any suggestions?
 

Paul Buttress

Registered User.
Local time
Today, 19:42
Joined
Feb 4, 2008
Messages
25
If either function is set to NULL and not just a blank then these will not be picked up. Maybe this could be the problem?
 

proballin

Registered User.
Local time
Today, 13:42
Joined
Feb 18, 2008
Messages
105
I thought that could be the case too...the same thing happens when I enclose each with Nz(). Maybe its something else?
 

Paul Buttress

Registered User.
Local time
Today, 19:42
Joined
Feb 4, 2008
Messages
25
I've had a similar problem and Nz() didn't work either but I tried similar to....

(MkFrmFunc_Table.Function1 = "" OR isnull(MkFrmFunc_Table.Function1) = true) And(MkFrmFunc_Table.Function2 = "" OR isnull(MkFrmFunc_Table.Function2) = true)

...........and all the other combinations, etc.....worth a try?
 

Users who are viewing this thread

Top Bottom