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  

How do I combine text fields in Access



 
 
Thread Tools Display Modes
  #1  
Old April 17th, 2010, 03:34 PM posted to microsoft.public.access.queries
Anja[_2_]
external usenet poster
 
Posts: 21
Default How do I combine text fields in Access

Hi,
I have a small database that keeps track of my mileage.
Every trip is recorded in one table with date, start odometer, end odometer
and a short description.

When I run the query that consolidate it into daily figures, the total miles
is calculated, NP - However I can not seem to combine the short into one
longer description. Most days there are more than one trip.
The descriptions to combine would be: "home to gas station and back home"
with home to aunt polly and back home" It would be fine if the combined
description is:" home to gas station and back home, home to aunt polly and
back home"

The problem is that it is the same field(column) but on two different records

Any assistance would be greatly appreciated
  #2  
Old April 17th, 2010, 05:00 PM posted to microsoft.public.access.queries
Ken Snell
external usenet poster
 
Posts: 177
Default How do I combine text fields in Access

You can use a function that will combine the values from the different
fields, using the date field to be the "key" that links the records
together; you then incorporate the function in your query that consolidates
the daily figures.

ConcatenateFieldValues
http://www.accessmvp.com/KDSnell/VBA...htm#ConcatFlds

--

Ken Snell
http://www.accessmvp.com/KDSnell/



"Anja" wrote in message
...
Hi,
I have a small database that keeps track of my mileage.
Every trip is recorded in one table with date, start odometer, end
odometer
and a short description.

When I run the query that consolidate it into daily figures, the total
miles
is calculated, NP - However I can not seem to combine the short into one
longer description. Most days there are more than one trip.
The descriptions to combine would be: "home to gas station and back home"
with home to aunt polly and back home" It would be fine if the combined
description is:" home to gas station and back home, home to aunt polly and
back home"

The problem is that it is the same field(column) but on two different
records

Any assistance would be greatly appreciated



  #3  
Old April 17th, 2010, 05:15 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default How do I combine text fields in Access

On Sat, 17 Apr 2010 07:34:01 -0700, Anja
wrote:

When I run the query that consolidate it into daily figures, the total miles
is calculated, NP - However I can not seem to combine the short into one
longer description. Most days there are more than one trip.
The descriptions to combine would be: "home to gas station and back home"
with home to aunt polly and back home" It would be fine if the combined
description is:" home to gas station and back home, home to aunt polly and
back home"


You'll need a little easy VBA code to do this. There's a sample at

http://www.mvps.org/access/modules/mdl0004.htm
--

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 12:05 PM.


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