473,598 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

append query or other to perform a task?

Hi,

I'm wondering if someone can help with the following problem. I have
2 tables in an access database from which I would like to create a
third table.

They look like this:

table 1 table 2
======== ========
FNAME LNAME FNAME LNAME COLOR
Jack Smith Jack Smith Green
Jack Smith Jack Smith Blue
Jack Smith Jack Smith Red
Jack Smith Jack Smith Orange
John Orr John Orr Black
John Orr John Orr Brown
John Orr John Orr Blue

I'd like Access to perform a comparison and find the same FNAME and
LNAME
in tables above, remove any duplicates, and pull out the data from
the correct 'color' fields into one 'colorsummary' field as
illustrated below:

RESULT:

FNAME LNAME COLORSUMMARY
===== ===== =============
Jack Smith Green, Blue, Red, Orange
John Orr Black, Brown, Blue

Any suggestions on how to achieve this is much appreciated. I have
worked before with Access queries (and after much experimenting dont
seem to be getting far!) but obviously am missing the needed expertise
to make the above happen. Alternately, if you have other suggestions
of other software/languages to use which would be simpler (eg., excel
or some DB language) that would be appreciated.

Thanks
Jack
Nov 12 '05 #1
4 1204
ja******@lycos. co.uk (Jack) wrote in
news:69******** *************** ***@posting.goo gle.com:
Hi,

I'm wondering if someone can help with the following problem. I have
2 tables in an access database from which I would like to create a
third table.

They look like this:

table 1 table 2
======== ========
FNAME LNAME FNAME LNAME COLOR
Jack Smith Jack Smith Green
Jack Smith Jack Smith Blue
Jack Smith Jack Smith Red
Jack Smith Jack Smith Orange
John Orr John Orr Black
John Orr John Orr Brown
John Orr John Orr Blue

I'd like Access to perform a comparison and find the same FNAME and
LNAME
in tables above, remove any duplicates, and pull out the data from
the correct 'color' fields into one 'colorsummary' field as
illustrated below:

RESULT:

FNAME LNAME COLORSUMMARY
===== ===== =============
Jack Smith Green, Blue, Red, Orange
John Orr Black, Brown, Blue

Any suggestions on how to achieve this is much appreciated. I have
worked before with Access queries (and after much experimenting dont
seem to be getting far!) but obviously am missing the needed expertise
to make the above happen. Alternately, if you have other suggestions
of other software/languages to use which would be simpler (eg., excel
or some DB language) that would be appreciated.

Thanks
Jack


Don't! Your plan violates the principle of atomicity; a row-column
intersection should hold just one value.

Read a little about
normalization,
relationships,
and
subforms/subreports.

You could end up with
something like:

People

UniqueID FName LName
1 Jack Smith
2 John Orr

Colours

UniqueID Color
1 Red
2 Orange
3 Yellow
4 Green
5 Blue
6 Purple
7 Brown
8 Black

PeopleWithColor s

UniqueID PeopleID ColorID
1 1 1
2 1 2
3 1 4
4 1 5
5 2 5
6 2 7
7 2 8

While this may seem strange, as you work with it, you will find that it
<<<may>>> be the most efficient design that you can create.

Access Report and Form frameworks were created with this type of design in
mind, ... or they should have been.
--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2
Thanks Lyle for your quick reply

FNAME and LNAME below are just examples as the application I'm working
on is to have my database remove duplicate addresses for the purpose
of a mailing

At each address I'd like a summary field (like a memo field, freeform
text field) which shows the names of people at that same address:

for example, source data looks like this

name address
joe 2 main st
sue 6 oak blvd
tom 2 main st
jim 2 main st
art 6 oak blvd

and I want the resulting database to look like this

address names
2 main st joe, tom, jim
6 oak blvd sue, art

the reason for this is so I can treat each address as one record and
have the names summarized in one field so these can be presented in
one place on the merge letter I'm creating

Any help on how to do this appreciated

Thanks,Jack

Don't! Your plan violates the principle of atomicity; a row-column
intersection should hold just one value.

Read a little about
normalization,
relationships,
and
subforms/subreports.

Nov 12 '05 #3
This should do what you want:

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

Say John, Jack & Jill share the same address....

Your query result would look something like:

John, Jack, Jill
Address
City, State, Zip
Nov 12 '05 #4
Thanks Pieter - I will give that a try!

Jack

pi********@hotm ail.com (Pieter Linden) wrote in message news:<bf******* *************** ***@posting.goo gle.com>...
This should do what you want:

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

Say John, Jack & Jill share the same address....

Your query result would look something like:

John, Jack, Jill
Address
City, State, Zip

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
2
5238
by: John | last post by:
Hi - I am trying to perform a simple append query, with no luck. I have a table (MktPrices) that has the following fields: BondID, PriceDate, Price. The objective is to allow the user to input a date and have the append query create a new record for each BondID, using the input date and the most recent price - which the user can then update on a tabular form. I have created a totals query (qryMostRecentPrice) which selects the most...
2
5777
by: JMCN | last post by:
hi i have a general question regarding append queries in access 97. each week i need to update my table(tblonlinereg) with new or modified records. firstly, i import the text file into my database and then i create a basic append query that appends the new records to the table(tblonlinereg). this works great if the field is greater than the last record appended ( where: tempID > 198 ) but how would i update/append the modifications...
4
1232
by: Jack | last post by:
Hi, I'm wondering if someone can help with the following problem. I have 2 tables in an access database from which I would like to create a third table. They look like this: table 1 table 2 ======== ========
5
23699
by: Daniel Wetzler | last post by:
Dear MS SQL Experts, I have to get the number of datasets within several tables in my MSSQL 2000 SP4 database. Beyond these tables is one table with about 13 million entries. If I perform a "select count(*) from table" it takes about 1-2 min to perform that task. Since I know other databases like MySQL which take less than 1 sec for the same task
1
1886
by: jpr | last post by:
Friends, I would like some help with a code that allows me to run an append query only if a specific field is not already stored into another table. Example. I add a new customer to my database using table1. I type his SSN. The code should check if this SSN is already present in another table (table2). If yes, so the code should skip the append query and just update any modified record included the SSN.
3
6483
by: blackd77 | last post by:
What I would LIKE to do is noted in the subject line. What I'm finding is that "edit SQL" appears to only be an option if I am creating a table. If I select "append to" the option to edit SQL shades itself as unavailable. The reason I'd like this is that there is a datum in the flat file that indicates whether that record should be appended to that table noted above. There are other ways of dealing with this "problem" but it would be...
1
4779
by: Jason Lepack | last post by:
I have a loop that loops through all records in all tables that have "TSE" as the first letters. In that loop, based upon conditions of the current record I have to add records to 1 of 5 different table. Now is it quicker to use 5 recordsets and add a new record to them, or is it faster to use append statements to append the records. ex. for each t in db.tabledefs if t.name like "tse*" then
6
2609
osward
by: osward | last post by:
Hi everyone, I have query(s) that I need to perform which I couldn't figure out, and following is the situation I have event table (which stores the event details) that has eid, date, time, place field, etc. I have a member table (which stores who join which event) that has the same field eid as event table but with other member information fields. When a member join an event, I want to check if he has already joined another event...
0
7981
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3894
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2410
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.