Access Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is an Access queries that allows me to take a
table that has two columns and combined them into one.
 
Sure:

Select Field1 & Field2 As TheFields
From YourTable;

Now there are times when you might want to do the following (such as working
with nulls); however, not with number fields as it will add them together:

Select Field1 + Field2 As TheFields
From YourTable;

Note: This will display the two fields as one. It does not actually combine
them together inside the table.
 
I am not sure if I understood your answer but when I tried it, it didn't
work. I think you meant for me to create another column, naming it
"thefields", which I did name it to my own discreption and then bring in the
two columns with their original name, which I did, but it did not work
 
Let's try this:

Open a new query in design view based on the table in question.

Drag down the first field.

Next in the in the same column, type in the second field with an ampersand
between the two fields like so:

[FirstField] & [SecondField]

Use the proper field names. If there aren't any special characters or
spaces, you may not need the brackets [].

Run the query? Does it look right? Go back to design view. You might notice
that access changed things a little like so as a field needs a name and
Access creates one:

Expr1: [FirstField] & [SecondField]

You can change the field name by replacing the wording before the colon like
this

MyFieldName: [FirstField] & [SecondField]

Again, you need to insert the proper field names. Also this does not change
the table in any way. It just presents the data already in the table a little
differently.
 
Back
Top