473,327 Members | 2,016 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,327 software developers and data experts.

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 1196
ja******@lycos.co.uk (Jack) wrote in
news:69**************************@posting.google.c om:
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

PeopleWithColors

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********@hotmail.com (Pieter Linden) wrote in message news:<bf*************************@posting.google.c om>...
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
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"...
2
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...
2
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...
4
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 ...
5
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...
1
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...
3
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...
1
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...
6
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,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.