Joining a number and text field

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

Guest

I have a table with 2 fields, 1 is number, 1 is text. I'd like to write a
query that combines the 2 of them as 1 field so I can use this new combined
field in another query. It appears I cannot join these 2 into 1 (because
they have different field types) without changing the number field to a text
field -- is tha correct? I'd appreciate your suggestions. Thank you.
 
I'd like to write a query that combines the 2 of them as 1 field so I can
use this new combined field in another query.
You can combine the two fields into a string. The field in the other query
will most likely need to be text also.

Post examples of your data to be combined and in the second query.
 
To combine fields of different types (in this case it is called
concatenating) in a query, you need to convert (those that need it) to the
resulting type:

[MyTextField] & CStr([MyNumberField])

Steve
 
T Location (table)
Shelf/Drawer/Box
Loc_Abbrv [ie, S, D, B]

T Number (table)
Number

I want to combine Loc_Abbrv [text] + Number [number] to make examples like
S1, D1, B1, etc.

2nd Query
Will pull data from T Reference (table) & [combined query] to make a report.
So it'll report

[Item name] is located in [blank location (combined query)]
 
SteveM - Many thanks. This worked like a champ.

SteveM said:
To combine fields of different types (in this case it is called
concatenating) in a query, you need to convert (those that need it) to the
resulting type:

[MyTextField] & CStr([MyNumberField])

Steve

GIraffe said:
I have a table with 2 fields, 1 is number, 1 is text. I'd like to write a
query that combines the 2 of them as 1 field so I can use this new combined
field in another query. It appears I cannot join these 2 into 1 (because
they have different field types) without changing the number field to a text
field -- is tha correct? I'd appreciate your suggestions. Thank you.
 

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