Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

two groups of detail on a report

Status
Not open for further replies.

Ouch

Programmer
Jul 17, 2001
159
GB
i'm lost

i have a query to produce a report
what i want on that report is "booking data"
then for every "booking" i want to show "equipment details" AND "Staff Details"

"equipment details" and "Staff Details" have multiple records for each record in "Booking Data"

i don't even know where to start!

i've done a report that works for "booking data" and shows all the "equipment details" but i dont know how to also show "Staff Details"
 

You can create join queries if you have defined the relationship between the tables. With little to go on, I'll still take a shot.

The following query assumes that the relationship between Bookings and [Staff Details] is defined by BookingsID which is the primary key in the Bookings table and a foreign key in the [Staff Details] table. As you didn't tell us the table structures, I guess there is some sort of StaffID and additional fields of info related to the booking.

Select b.BookingID, s.StaffId, s.StaffDetail, ...
From Booking b Inner Join [Staff Details] s
On b.BookingID=s.BookingID

Hope this gives you some ideas. You can do a similar query for [Equipment Details]. Of course, all of this assumes proper database design, some sort of relationship between tables, normalization, etc. Terry Broadbent

"The greatest obstacle to discovery is not ignorance -- it is the illusion of knowledge." - Daniel J Boorstin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top