concatenate text field problems

G

Guest

Hi,

I am running a query that concatenates two text fields into one, the
statement in the Field box in the query design grid looks like this:

Site:
![Station ID] & " - " &
![Station Name]

As stated, both [Station ID] and [Station Name] are text fields. The query
concatenates the two fields, but the results are records where there is
variable length in space between the [Station ID] field and the " - ".
Records look like this:

C03SALML01 - Salmon Lake
4328AL01 - ALICE CREEK
HE409 - HOGUM, EAST FORK
C03POORC02 - Poorman Creek -first stream crossing d/s of SF

What I want is just one space between the [Station ID] and the " - ", like
the first example in the previous list. Any ideas what may be going on? thanx
 
V

Van T. Dinh

It looks to me that the data was imported into Access and there are traling
spaces / white characters in the imported Field values.

Site: Trim(
![Station ID]) & " - " & Trim(
![Station Name])

Alternatively, to remove the trailing spaces in the Table values, use Trim()
in an Update Query.
 
G

Guest

That did it!! Thank you very much, one day I hope to know this stuff to a
level that I know what commands are needed for what seemingly basic stuff
like this!!

Van T. Dinh said:
It looks to me that the data was imported into Access and there are traling
spaces / white characters in the imported Field values.

Site: Trim(
![Station ID]) & " - " & Trim(
![Station Name])

Alternatively, to remove the trailing spaces in the Table values, use Trim()
in an Update Query.


--
HTH
Van T. Dinh
MVP (Access)



Giz said:
Hi,

I am running a query that concatenates two text fields into one, the
statement in the Field box in the query design grid looks like this:

Site:
![Station ID] & " - " &
![Station Name]

As stated, both [Station ID] and [Station Name] are text fields. The query
concatenates the two fields, but the results are records where there is
variable length in space between the [Station ID] field and the " - ".
Records look like this:

C03SALML01 - Salmon Lake
4328AL01 - ALICE CREEK
HE409 - HOGUM, EAST FORK
C03POORC02 - Poorman Creek -first stream crossing d/s of SF

What I want is just one space between the [Station ID] and the " - ", like
the first example in the previous list. Any ideas what may be going on?
thanx
 
V

Van T. Dinh

Grab a reasonably-sized Access book and read it from front cover to back
cover and you'll know how the answers to 80% of questions ask in these
newsgroups.
 
G

Guest

What book do you suggest?
--
Thanks A Bunch


Van T. Dinh said:
Grab a reasonably-sized Access book and read it from front cover to back
cover and you'll know how the answers to 80% of questions ask in these
newsgroups.
 

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