Basic IF statement question

  • Thread starter Thread starter NeonSky via AccessMonster.com
  • Start date Start date
N

NeonSky via AccessMonster.com

Hello All!

Hi, what I am trying to do sounds quite simple though I am not sure how to do
it. Here is the scenario: If field "A" is null and field "B" is not null then
populate field "A" with data from field "B" and then delete the contents of
field "A".

Your assistance is much appreciated!

Thank you!
 
Does not compute!

You are taking data from field "B", putting it in "A", and deleting the data
from "A"?!

Take a look at an update query to accomplish this, and the IIF() function to
evaluate if "A" is null (?or a zero-length string?) and "B" is not.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Hello All!

Hi, what I am trying to do sounds quite simple though I am not sure how to do
it. Here is the scenario: If field "A" is null and field "B" is not null then
populate field "A" with data from field "B" and then delete the contents of
field "A".

I'm confused.

It sounds like you want to fill field A and then empty it, thereby
doing nothing at all.

I could make a guess at what you MEANT to say... but I'd rather you
say it so there's a better chance of it matching what you actually
want!

John W. Vinson[MVP]
 
You both are tottaly right, my mistake. I meant to say: If field "A" is null
and field "B" is not null then
populate field "A" with data from field "B" and then delete the contents of
field "B".

Thanks!!!
 
You both are tottaly right, my mistake. I meant to say: If field "A" is null
and field "B" is not null then
populate field "A" with data from field "B" and then delete the contents of
field "B".

Update queries happen "all at once", not procedurally in sequence - so
you can simply

UPDATE MyTable
SET [A] = ,
= NULL
WHERE [A] IS NULL
AND IS NOT NULL;


John W. Vinson[MVP]
 
u rock.

John said:
You both are tottaly right, my mistake. I meant to say: If field "A" is null
and field "B" is not null then
populate field "A" with data from field "B" and then delete the contents of
field "B".

Update queries happen "all at once", not procedurally in sequence - so
you can simply

UPDATE MyTable
SET [A] = ,
= NULL
WHERE [A] IS NULL
AND IS NOT NULL;

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top