Hi all,
Can someone offer suggestions as to how to accomplish the following?
I have a table with 3 fields: date, truck, and driver, in this table I have the next data:
2002-02-01, truck1, driver1
2002-02-02, truck1, driver1
2002-02-03, truck1, driver1
2002-02-04, truck2, driver1
2002-02-05, truck2, driver1
2002-02-06, truck1, driver1
2002-02-07, truck1, driver1
I want to generate a report that shows what trucks each driver had, and the period of time that the driver had the truck. Please notice that if a driver use a truck in 2 different time periods it should appears as 2 different rows. The report should look like this:
driver1
truck1 2002-02-01 - 2002-02-03
truck2 2002-02-04 - 2002-02-05
truck1 2002-02-06 - 2002-02-07
I have been trying a couple of ways to do this, but so far I haven't been lucky. I really appreciate any help or advice on this regard.
Thanks in advance.
andres
Can someone offer suggestions as to how to accomplish the following?
I have a table with 3 fields: date, truck, and driver, in this table I have the next data:
2002-02-01, truck1, driver1
2002-02-02, truck1, driver1
2002-02-03, truck1, driver1
2002-02-04, truck2, driver1
2002-02-05, truck2, driver1
2002-02-06, truck1, driver1
2002-02-07, truck1, driver1
I want to generate a report that shows what trucks each driver had, and the period of time that the driver had the truck. Please notice that if a driver use a truck in 2 different time periods it should appears as 2 different rows. The report should look like this:
driver1
truck1 2002-02-01 - 2002-02-03
truck2 2002-02-04 - 2002-02-05
truck1 2002-02-06 - 2002-02-07
I have been trying a couple of ways to do this, but so far I haven't been lucky. I really appreciate any help or advice on this regard.
Thanks in advance.
andres