469,291 Members | 1,783 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,291 developers. It's quick & easy.

How to write an if statement in an update query.

Here's what I need to happen in my table: if field 4 = DP I need field 2 to equal 02 else equal 10.

Simple right?
May 10 '11 #1

✓ answered by Rabbit

The IIF function syntax is
IIf(true/false expression, true value, false value)

5 12440
Rabbit
12,516 Expert Mod 8TB
The IIF function syntax is
IIf(true/false expression, true value, false value)
May 10 '11 #2
I don't understand how to write what you are suggesting. Can you write it for me using my data?
May 10 '11 #3
Rabbit
12,516 Expert Mod 8TB
Sorry but that's not what I do. I will guide you towards the answer if you show that you're willing to put in the work to arrive at the answer. But I will not give out the answer.
May 10 '11 #4
Nevermind Rabbit, I figured it out. I used:
Expand|Select|Wrap|Line Numbers
  1. IIf("USER FIELD 4]"="DP","02","10")
Thank you for your help!!
May 10 '11 #5
NeoPa
32,173 Expert Mod 16PB
I'm afraid that doesn't work. It couldn't possibly as it always returns a FALSE result ("USER FIELD 4]" can never be equal to "DP"). Do you possibly mean :
Expand|Select|Wrap|Line Numbers
  1. IIf([USER FIELD 4]="DP","02","10")
May 11 '11 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by rrh | last post: by
2 posts views Thread by fong.yang | last post: by
1 post views Thread by dee | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.