Greetings, CR gurus!
We have CR 10 connected via ODBC to an Oracle db.
I'm getting a little over my head and desperately need some help with record selection. Our database tracks travel & leisure reservations booked for our customers. I am tasked with generating a list to be run weekly showing completed reservations so we can send a satisfaction survey.
For this project, here are the pertinent fields for each reservation record:
Booking ID #
Customer ID #
Customer Name (Last, First)
Service Facility #
Reservation Date/Time
Reservation Type
Reservation ID #
When a customer calls, they might book multiple reservations (tee time + dining reservation + hotel). They might also book multiple individuals such as spouses/dependents (same Cust ID#) or even friends who have their own Cust ID#. All of these scenarios would be a separate row/record in the database, identified by a unique Reservation ID# but they are all under a single Booking ID#.
The tricky part is that we only want to send a survey to the person who booked the reservation. That person will always be the first person who appears when you retrieve all reservations, group them by Booking ID#, and then sort within the Booking by Reservation ID# in ascending order.
Here's an example of how the data might look.
BOOKING ID# CUST ID# CUST NAME FACILITY # RESV DATE RES TYPE RES ID#
10 S100 MR SMITH 90100 10/1/2006 GOLF 1234
10 S100 MS SMITH 90100 10/1/2006 GOLF 1235
10 G200 MR GRAY 90100 10/1/2006 GOLF 1236
10 S100 MR SMITH 90200 10/1/2006 DINING 1237
10 S100 MS SMITH 90200 10/1/2006 DINING 1238
10 G200 MR GRAY 90200 10/1/2006 DINING 1239
10 S100 MR SMITH 90300 10/2/2006 THEATER 1240
10 S100 MS SMITH 90300 10/2/2006 THEATER 1241
10 G200 MR GRAY 90300 10/2/2006 THEATER 1242
In this example, there are 3 individuals in the booking -- Mr & Mrs Smith (S100) and their friend Mr. Gray (G200). They made golf, dining, and theater reservations at different facilities and on different dates. Mr. Smith is the reservation maker as indicated by having the lowest Res ID#.
The desired result is to only select each of the records for MR SMITH (since he booked it) to survey their golf, dining, and theater experience. The rows for MS. SMITH and MR. GRAY would not show up in the report. The record selection must be done within each Booking ID as the same customer might call back the next day and book additional reservations on a new Booking (which we'd want to survey as well).
Any ideas?????
Thanks!
We have CR 10 connected via ODBC to an Oracle db.
I'm getting a little over my head and desperately need some help with record selection. Our database tracks travel & leisure reservations booked for our customers. I am tasked with generating a list to be run weekly showing completed reservations so we can send a satisfaction survey.
For this project, here are the pertinent fields for each reservation record:
Booking ID #
Customer ID #
Customer Name (Last, First)
Service Facility #
Reservation Date/Time
Reservation Type
Reservation ID #
When a customer calls, they might book multiple reservations (tee time + dining reservation + hotel). They might also book multiple individuals such as spouses/dependents (same Cust ID#) or even friends who have their own Cust ID#. All of these scenarios would be a separate row/record in the database, identified by a unique Reservation ID# but they are all under a single Booking ID#.
The tricky part is that we only want to send a survey to the person who booked the reservation. That person will always be the first person who appears when you retrieve all reservations, group them by Booking ID#, and then sort within the Booking by Reservation ID# in ascending order.
Here's an example of how the data might look.
BOOKING ID# CUST ID# CUST NAME FACILITY # RESV DATE RES TYPE RES ID#
10 S100 MR SMITH 90100 10/1/2006 GOLF 1234
10 S100 MS SMITH 90100 10/1/2006 GOLF 1235
10 G200 MR GRAY 90100 10/1/2006 GOLF 1236
10 S100 MR SMITH 90200 10/1/2006 DINING 1237
10 S100 MS SMITH 90200 10/1/2006 DINING 1238
10 G200 MR GRAY 90200 10/1/2006 DINING 1239
10 S100 MR SMITH 90300 10/2/2006 THEATER 1240
10 S100 MS SMITH 90300 10/2/2006 THEATER 1241
10 G200 MR GRAY 90300 10/2/2006 THEATER 1242
In this example, there are 3 individuals in the booking -- Mr & Mrs Smith (S100) and their friend Mr. Gray (G200). They made golf, dining, and theater reservations at different facilities and on different dates. Mr. Smith is the reservation maker as indicated by having the lowest Res ID#.
The desired result is to only select each of the records for MR SMITH (since he booked it) to survey their golf, dining, and theater experience. The rows for MS. SMITH and MR. GRAY would not show up in the report. The record selection must be done within each Booking ID as the same customer might call back the next day and book additional reservations on a new Booking (which we'd want to survey as well).
Any ideas?????
Thanks!