address in one line

P

Pat

Hi all,

I am trying to get query to return record like follow:

name
123 mian st.
houston, tx 77082
USA

but the result i get is as followed:
name
123 main st.
houston
tx
77082
USA
what do i need to chage in the query? the query as followed:


SELECT
vendor.VENDOR_NAME & Chr(10) & Chr(13) & vendor.Address
& Chr(10) & Chr(13) & vendor.City & " , " & vendor.State & " ' " &
vendor.Zip
& Chr(10) & Chr(13) & vendor.Country

from vendor
 
K

KARL DEWEY

I would say it is not possible you are getting the results you say is from
the query you posted.
Why does your query have a space preceeding the comma like this --
vendor.City & " , " & vendor.State

That comma is not showing in the results you posted. It seems you have
more than one query and are seeing the output from a different one than you
posted.
 
P

Pat

sorry the query is as followed:

SELECT
vendor.VENDOR_NAME & Chr(10) & Chr(13) & vendor.Address
& Chr(10) & Chr(13) & vendor.City & Chr(10) & Chr(13) & vendor.State &
Chr(10) & Chr(13) & vendor.Zip & Chr(10) & Chr(13) & vendor.Country

from vendor
 
K

KARL DEWEY

Try this --
SELECT vendor.VENDOR_NAME & Chr(10) & Chr(13) & vendor.Address
& Chr(10) & Chr(13) & vendor.City & ", " & vendor.State & " " & vendor.Zip &
Chr(10) & Chr(13) & vendor.Country
FROM vendor;
 
J

John W. Vinson

Hi all,

I am trying to get query to return record like follow:

name
123 mian st.
houston, tx 77082
USA

Chr(13) & Chr(10) is how you insert a newline (carriage return - linefeed)
into a string. If you don't want the newline don't include the Chr() calls:
put in an explicit blank instead.

SELECT
vendor.VENDOR_NAME & Chr(10) & Chr(13) & vendor.Address
& Chr(10) & Chr(13) & vendor.City & " " & vendor.State &
" " & vendor.Zip & Chr(10) & Chr(13) & vendor.Country
 

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