473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Query to combine names from different records with the same address?

2
Here an image of my table:



I need a query that will combine the first names of each person who lives at a particular address combined with their last name.

Essentially, I need this:

Abram Jeffery 858 Crystal Lake Rd. Whitehall, MI 49461
Abram Petra 858 Crystal Lake Rd. Whitehall, MI 49461


To be this:

Jeffery & Petra Abram 858 Crystal Lake Rd. Whitehall, MI 49461

I cannot combine the records. They need to remain distinct.
Any help would be appreciated.

Thank you.
Mar 18 '17 #1

✓ answered by jforbes

Using this function is about the only way I know to do this in Access:Concatenate values from related records

3 2454
jforbes
1,107 Expert 1GB
Using this function is about the only way I know to do this in Access:Concatenate values from related records
Mar 20 '17 #2
PhilOfWalton
1,430 Expert 1GB
Your database is not normalised.
You should have a table of addresses with AddressID as the key, and a table of Contacts with AddressID as the foreign key.

Simple guide to normalisation. Anything in a table should be self contained, so Contacts would include names, emails, mobile phone, hair colour, gender etc. That contact exists in his or her own right.

Similarly an address (house) exists in it's own right. Whether that address has anyone living in it that is relevant to you is immaterial. The address would contain details of Address lines & Zip code. To my mind, the Towns should be in a separate table, as should the State, because both Towns & States exist in their own right.

If you get this set up properly, and use a Combo box to select a town, then the State is automatic. Equally once a town is set into the database, there is no possibility of spelling mistakes.

Possibly this picture will give you the right idea (bearing in mind this is for the UK)



Phil
Mar 20 '17 #3
Roknor
2
Wow, thank you both for your suggestions.

JForbes, the concatenate function is exactly what I was looking for. I could do it in Excel easy enough, I just couldn't figure out the formulas for Access. Thankfully, I was able to get this to work, but with 10,000 records it did take a while for the query to run. I should be able to fiddle with it to get what I want.

PhilofWatson, I will have to figure out the best way to import the excel files into my database in order to get the best table set up and still have the proper connections. This is not my data, it is a copy of the voter rolls I receive after each election. There are over 28 columns of data, each value has it's own column. (E.g. Street prefix, Street Number, street name, street suffix, apartment number, state, city, zip, etc.) I simplified it for my example above.

Again, thank you both very much.
Mar 21 '17 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Alexander N. Spitzer | last post by:
If I have a machine with 3 virtual IP addresses (192.168.1.), how can I start 3 instances of the same RMI application (each started with different properties/configs), each listening on the port...
2
by: jcabc | last post by:
The row counts I am getting from SQL Enterprise Manager and Query Analyzer are different. When I double click a table in Enterprise Manager it gives me a row count of say 1000. However, when I...
1
by: Megan | last post by:
Hi everybody- For some reason, I cannot get this query to work. I have 2 identical tables. One table is new, the other is old. I want to be able to tell which records in the newer table are...
1
by: snOOp | last post by:
I am trying to combine the data from two similar tables into one query, but I need for all of the records from both tables to show up and I want the ones that have matching 'emplid' to be combined...
2
by: Viviana R via AccessMonster.com | last post by:
I'm tryin to calculate de difference of time between different records and fields. I have a Report with date, time In, and Time Out fields. EX: Date Time IN Time Out 4/12/05 12:10...
1
by: Venk | last post by:
I want to combine 2 different reports. That is Report 1 should be followed by report 2 If Report 1 is in Page 1, automatically report2 should be in page2 Any thought or help on this would be...
8
by: Gem | last post by:
Hi I'm struggling with a query returning too many records. I have 3 related tables. tblPatients tblOperations tblTargets Each patient in tblPatients can have more than one operation...
1
by: rfranzl | last post by:
Hello, I need some help, I have about 200 databases that are copies of an original database that has a similiar table in all of the databases, called "tblCodebook". What I am trying to do is to...
3
by: Coll | last post by:
I have a form that had been setup with a combo box. You'd select a value from the combo box and a query would open and display matching records. I now need to remove the combo box and set up a text...
2
doma23
by: doma23 | last post by:
Would it be possible later to do query calculations between two records even when one of the two records doesn't exist? Example: COMPANY____PERIOD___SALES Company1___1H2012___125...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.