concatenate text field problems

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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
 
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.
 
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.
 
Back
Top