Combining City and State Errors

J

jwrnana

I have tried the following expressions in my query to combine my city,
state, zip code and country.

=[ShipCity]&[ShipStateOrProvince]&[ShipPostalCode]&[ShipCountry]

In this expression, I get the correct return of data, but without
spaces and commas. If I put spaces and commas, I get just the field names
exactly as typed in the expression.

"[ShipCity]&" "& [ShipStateOrProvince]&" "&[ShipPostalCode]&" "&
[ShipCountry]"

In this expression, I get errors and no return of data.


Any suggestions?

Thank you,
JR
 
B

Brendan Reynolds

=[ShipCity] & ", " & [ShipStateOrProvince] & ", " & [ShipPostalCode] & ", "
& [ShipCountry]

Note the placement of the quotes. Only the literals (spaces and commas in
this example) go inside the quotes, the field names remain outside the
quotes.
 
J

jwrnana

Thank you - that worked!
Brendan Reynolds said:
=[ShipCity] & ", " & [ShipStateOrProvince] & ", " & [ShipPostalCode] & ", "
& [ShipCountry]

Note the placement of the quotes. Only the literals (spaces and commas in
this example) go inside the quotes, the field names remain outside the
quotes.

--
Brendan Reynolds
Access MVP


jwrnana said:
I have tried the following expressions in my query to combine my city,
state, zip code and country.

=[ShipCity]&[ShipStateOrProvince]&[ShipPostalCode]&[ShipCountry]

In this expression, I get the correct return of data, but without
spaces and commas. If I put spaces and commas, I get just the field names
exactly as typed in the expression.

"[ShipCity]&" "& [ShipStateOrProvince]&" "&[ShipPostalCode]&" "&
[ShipCountry]"

In this expression, I get errors and no return of data.


Any suggestions?

Thank you,
JR
 

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