SQl Query
|
|||
|
Rank: ? (1)
Member #: 26113 |
I have two Tables Customer and Visit
I want to display the next 4 visit Dates Against Each Customer Customer Table ID Customer1 1 Customer1 2 Customer2 3 Customer3 4 Customer4 5 Customer5 6 Customer6 Visit Table CustomerId VisitDate 3 12/15/2005 4 12/10/2005 2 12/22/2005 3 12/22/2005 1 12/22/2005 3 12/29/2005 2 12/25/2005 Which should Display as (Following are dummy data) Customer Name Visit1 Visit2 Visit3 Visit4 Customer 1 12/15/2005 12/18/2005 12/21/2005 12/24/2005 Customer 2 12/13/2005 12/16/2005 12/25/2005 Customer 3 12/14/2005 12/20/2005 Customer 4 12/16/2005 12/19/2005 12/26/2005 Customer 5 12/19/2005 12/22/2005 Customer 6 12/6/2005 12/18/2005 Customer 7 12/25/2005 12/26/2005 12/28/2005 12/29/2005 Thanx in Advance |
||
|
|||
|
|||
|
Rank: ? (4821)
Member #: 3416 |
i think you'd have to do one query to get each customer, then another query per customer to get the next 4 dates.
my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
|
||
|
Please login or register to post a reply.