A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

address in one line



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2010, 03:24 PM posted to microsoft.public.access.queries
Pat
external usenet poster
 
Posts: 677
Default address in one line

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

  #2  
Old May 11th, 2010, 04:10 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default address in one line

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.

--
Build a little, test a little.


"Pat" wrote:

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

  #3  
Old May 11th, 2010, 04:15 PM posted to microsoft.public.access.queries
Pat
external usenet poster
 
Posts: 677
Default address in one line

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

"KARL DEWEY" wrote:

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.

--
Build a little, test a little.


"Pat" wrote:

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

  #4  
Old May 11th, 2010, 04:43 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default address in one line

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;

--
Build a little, test a little.


"Pat" wrote:

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

"KARL DEWEY" wrote:

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.

--
Build a little, test a little.


"Pat" wrote:

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

  #5  
Old May 11th, 2010, 04:53 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default address in one line

On Tue, 11 May 2010 07:24:01 -0700, Pat wrote:

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

--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.