I need some help! I have 2 tables:
Hotel_Coupon
Player_ID
RedeemDate
Gaming_Details
Player_ID
GamingDate
StartDateTime
EndDateTime
Actual
Theo
Type (Pit or Slot)
Example of one player:
Player_ID Type Actual Theo GamingDate StartTime EndTime
14841 SLOT $5.42 $0.82 6/8/2010 6/8/2010 9:45:06 AM 6/8/2010 9:46:34 AM
14841 SLOT ($135.60) $4.03 6/8/2010 6/8/2010 9:46:51 AM 6/8/2010 9:50:39 AM
14841 PIT ($150.00) $28.13 6/8/2010 6/8/2010 9:50:00 AM 6/8/2010 10:50:00 AM
14841 SLOT $39.90 $10.85 6/9/2010 6/9/2010 11:30:15 AM 6/9/2010 11:42:10 AM
I am needing to know the total Actual and Theo by Type by Player_ID by RedeemDate. But I need these totals to be from RedeemDate through the next GamingDate with EndDateTime <=12:00:00 pm. The above example should result in:
Player_ID SlotActual SlotTheo PitActual PitTheo GamingDate
14841 ($90.28) $15.69 ($150.00) $28.13 06/08/2010
I've been trying to come up with a solution for days and coming up with nothing. Or do I tell my boss it isn't possible.
Thanks in advance for any help.
Debbie
Hotel_Coupon
Player_ID
RedeemDate
Gaming_Details
Player_ID
GamingDate
StartDateTime
EndDateTime
Actual
Theo
Type (Pit or Slot)
Example of one player:
Player_ID Type Actual Theo GamingDate StartTime EndTime
14841 SLOT $5.42 $0.82 6/8/2010 6/8/2010 9:45:06 AM 6/8/2010 9:46:34 AM
14841 SLOT ($135.60) $4.03 6/8/2010 6/8/2010 9:46:51 AM 6/8/2010 9:50:39 AM
14841 PIT ($150.00) $28.13 6/8/2010 6/8/2010 9:50:00 AM 6/8/2010 10:50:00 AM
14841 SLOT $39.90 $10.85 6/9/2010 6/9/2010 11:30:15 AM 6/9/2010 11:42:10 AM
I am needing to know the total Actual and Theo by Type by Player_ID by RedeemDate. But I need these totals to be from RedeemDate through the next GamingDate with EndDateTime <=12:00:00 pm. The above example should result in:
Player_ID SlotActual SlotTheo PitActual PitTheo GamingDate
14841 ($90.28) $15.69 ($150.00) $28.13 06/08/2010
I've been trying to come up with a solution for days and coming up with nothing. Or do I tell my boss it isn't possible.
Thanks in advance for any help.
Debbie