473,395 Members | 1,437 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,395 software developers and data experts.

Query to return same record more than once

I have a table that holds customer contact information. The table has
three email fields (Email1, Email2, and Email3). So each customer can
have up to 3 contact email addresses.

I need a query that will return the customers name with each of their
email addresses.

ie If customer has 3 email addresses then following is returned:

Bill Morrison Email1
Bill Morrison Email2
Bill Morrison Email3

Hope this makes sense

Thanks
Nov 13 '05 #1
1 1625
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It would be better to put the email addresses in a separate table. This
will Normalize your db. E.g.:

Customers CustEmails
- ----------- ---------------
CustID 1-->m CustID,
<other fields> Email

This way you can have many emails per customer.

The query would be like this:

SELECT C.FirstName & " " & C.LastName, E.Email
FROM Customers As C INNER JOIN CustEmails As E
ON C.CustID = E.CustID
WHERE <criteria>

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQUx1WoechKqOuFEgEQIMxACgj9FpY+U7KVzcsV4ki3QoJh iMwwIAn1h+
ebU4MjL0nKj1efejTVu/lkXo
=bigj
-----END PGP SIGNATURE-----
Bill Morrison wrote:
I have a table that holds customer contact information. The table has
three email fields (Email1, Email2, and Email3). So each customer can
have up to 3 contact email addresses.

I need a query that will return the customers name with each of their
email addresses.

ie If customer has 3 email addresses then following is returned:

Bill Morrison Email1
Bill Morrison Email2
Bill Morrison Email3


Nov 13 '05 #2

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

Similar topics

5
by: jason | last post by:
I could sure use some conceptualization and query help with a Page Watch System I am building in Access 2000 and Asp. I need to cycle through databae and generate a compiliation query email that...
4
by: Spark | last post by:
Hi, Situation: Need a query to return number of ticket records by month of open in a log table where the ticket open record is older than 24 hours then the ticket pending or ticket closed...
3
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
4
by: oh patty | last post by:
I have a query that finds results that meet any 1 of 3 criteria. It is possible for each record to meet 0, 1, 2, or all 3 of the criteria. When I run the query, each record will show up once for...
5
by: Lyn | last post by:
This one is difficult to explain, so I will cut it down to the basics. I have a major table 'tblA' which has an autonum field 'ID-A' as primary key (of no significance to users). 'tblA' contains...
5
by: marcsirois | last post by:
I have an SQL Query that looks like this. I simplified it for the purpose of this example, but it's still a runnable query SELECT TOP 1 FundedPositions.PositionNumber AS , (select top 1...
8
by: olivero | last post by:
Hi group, Is there an easy way to make a form create the same set of fields dynamically, once for each record returned by a query? I have a query that's being called from a form and the results...
7
by: Wildster | last post by:
Hi, I’ve setup a table which contains records with multiple duplicated time fields (tblTime_Slots) i.e. ID Time_Slot 1 08:00 2 08:00 3 09:00 4 09:00 etc…
11
by: lenygold via DBMonster.com | last post by:
Hi everybody! This query is supposed to count consecutive years from the current year without OLAP. Input Table: ID DateCol 1 02/01/2006 1 01/01/2006 1 01/01/2005
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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.