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

Need Query to return multiple rows per record in layman's terms

2
i am working in Access 97, our database tables are linked from ODBCsqlsvr (not even sure what that means). i have a table where each record has a unique customer and their order information. there are 20 possible items to be ordered.

i need a query that will return a unique row for every item ordered. if the same customer (record) orders 3 items, i need the query to return 3 rows. Each row will have the same customer info (name, address, etc.) but the different items ordered. some item fields are yes/no, and other fields just record the quantity of that item and other items record the actual name of the item.

i have tried to make several queries, first i created 20 queries to return the records that ordered that item. then i added those 20 queries into one query but i didn't know how to link them or what the next step should be.

i also tried to use OR in criteria but i can only go 7 lines down, and i have 20 items.

so i tried to read through threads to find help but any threads i thought may come close to what i need confused me more. i think i found a similar problem in a thread called "How to extract multiple entries" from april 28th. although i have no idea what the language means.

if anyone can help explain to me what kind of query i need to create and maybe the basic criteria needed i would be forever thankful. please keep in mind, i don't understand the sql language so well, i don't even know what the purpose of a crosstab query or a form is. i am desperate to make this work. thanks.
May 5 '07 #1
2 2692
are the ordered products in the same records

ie CustID , name , address , prod1 , prod2, prod7

or products in multiple rows like this

ie: CustID, Name, Address, prod1
CustID, Name, Address, prod2

If it is the later try putting this in the criteria

in ("prod1", "prod2", "prod3",...."Prod20")
May 5 '07 #2
jennk
2
in the table the ordered products are all in the same record

ie Cust1 , name , address , prod1 , prod2, prod7
Cust2 , name , address , prod1 , prod2

but i want a query to give me multiple rows like this

ie: Cust1, Name, Address, prod1
Cust1, Name, Address, prod2
Cust1, Name, Address, prod7
Cust2, Name, Address, prod1
Cust2, Name, Address, prod2
May 5 '07 #3

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

Similar topics

5
by: John Bailo | last post by:
I wrote a webservice to output a report file. The fields of the report are formatted based on information in an in-memory XmlDocument. As each row of a SqlDataReader are looped through, a...
2
by: Hammy Hammy | last post by:
Hi all, I have an invoice table query that returns 10 records. ie. there are 10 invoices. When I try to join a subjects table to retrieve the subject name associated with an invoice it returns...
10
by: Mark | last post by:
I have a table about people containing 25 fields. The table contains the usual fields - first, last, address, city, state and zip. There is no primary key. These fields all have data with the...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
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...
6
by: MVM | last post by:
Hi, I am attempting to run a query in MS SQL server between two tables that have a one to many relationship. The tables are linked on GID. What I want is one instance of every record from Table...
3
by: shorti | last post by:
db2 v 8.2 on AIX 5.3 I will try to explain as brief as I can what it is I need. I am building a function that will be called multiple times where I will need to return x amount of records each...
1
by: tjm0713 | last post by:
Not sure this can be done but here is my current situation. I have a table containing millions of records. Each record has 28 fields. One of the fields I am trying to return the single record for...
13
by: Neil | last post by:
I'm running an update query in SQL 7 from QA, and it runs forever. Has been running for 20 minutes so far! The query is quite simple: update a single field in a table, based on a join with another...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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,...
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...

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.