Update same table based on column data

M

musa.biralo

Hi there...

Sorry for these simple question...

Table AA
ColA ColB ColC
Row1 A <null>
Row2 B <null>
Row3 C Z
Row4 D Y

Now, I am trying to update the ColA based on this:

If ColC = "" then (if ColC is blank then)
ColA = ColB
Else
ColA = ColC
EndIf

I could do this in excel but not in Access :( .. help is poor
fellow... Thanks

musa.biralo
 
J

Jeanette Cunningham

Hi musa.biralo,
we like the simple questions as much as the hard ones.
Here is the answer in 2 simple steps.

In the query grid under ColC in the criteria row, type Is Null.
In the Update to row, type [AA].[ColB]
Run the query.

Now open the query design and remove the criteria.
In the criteria row for ColC type Is Not Null.
In the Update to row, type [AA].[ColC]
Run the query.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
M

musa.biralo

Thanks that worked!
I should have known that...but now i know

Thanks again.
musa.biralo


Hi musa.biralo,
we like the simple questions as much as the hard ones.
Here is the answer in 2 simple steps.

In the query grid under ColC in the criteria row, type Is Null.
In the Update to row, type [AA].[ColB]
Run the query.

Now open the query design and remove the criteria.
In the criteria row for ColC type Is Not Null.
In the Update to row, type [AA].[ColC]
Run the query.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Hi there...
Sorry for these simple question...
Table AA
               ColA   ColB   ColC
Row1                    A       <null>
Row2                    B       <null>
Row3                    C         Z
Row4                     D        Y
Now, I am trying to update the ColA based on this:
If ColC = "" then    (if ColC is blank then)
 ColA = ColB
Else
  ColA = ColC
EndIf
I could do this in excel but not in Access :( .. help is poor
fellow... Thanks
musa.biralo
 

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

Top