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!
Jeff Boyce - 29 Nov 2006 23:55 GMT
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!
>
[quoted text clipped - 9 lines]
>
> Thank you!
John Vinson - 29 Nov 2006 23:58 GMT
>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]
NeonSky - 30 Nov 2006 00:08 GMT
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!!!
>>Hello All!
>>
[quoted text clipped - 13 lines]
>
> John W. Vinson[MVP]
John Vinson - 30 Nov 2006 04:41 GMT
>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] = [B],
[B] = NULL
WHERE [A] IS NULL
AND [B] IS NOT NULL;
John W. Vinson[MVP]
NeonSky - 30 Nov 2006 15:17 GMT
u rock.
>>You both are tottaly right, my mistake. I meant to say: If field "A" is null
>>and field "B" is not null then
[quoted text clipped - 11 lines]
>
> John W. Vinson[MVP]