Merge two columns

  • Thread starter Thread starter JR
  • Start date Start date
J

JR

I have a bunch of columns of data in a table. I have created an
additional blank column. What I'm looking to do is merge Column A and
B into C. Basically Table A and B will never have data in both columns
within the same row. So if one row in A has data, B will not and visa
versa. I want to merge all the fields with data into C. Any query
help would be appreciated.

Thanks.

JR
 
Dear JR:

Your post is exceedingly confusing. First, you speak of Column A and Column
B, then of Table A and B. Then you aren't speaking of columns, but of
fields. Visa is a credit card, not Latin.

I'm assuming this is about columns, not tables, and you have paid your full
balance on the credit card.

Use IIf() to test whether column A is "empty". This may mean NULL or "", or
either.

IIf(A = "", B, A)

or

IIf(IsNull(A), B, A)

or even:

IIf(Nz(A, "") = "", B, A)

Tom Ellison
 
Thanks for the response Tom. Could have been a little less critical,
however yes, I meant column where I put table.
 
Dear JR:

I tried to make it a bit light hearted. No offense, please! It is not
uncommon for me to miss entirely the meaning of someone's post when I have
to start guessing at what is meant. This comes from experience.

Now, given that I did guess correctly as to your meaning, did you get any
help?

Tom Ellison
 
I don't quite get the Table A and B thing. You started talking columns and
switched to tables and back to columns. You aren't in politics, are you :)

Anyway, assuming what you really mean is 3 columns in one table where you
want to put the value of A or B into C. Create an update query. The formula
you need to update column C is:

Nz(ColumnA,"") & Nz(ColumnB,"")
 

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

Back
Top