View Single Post
Old 04-09-2011, 02:24 PM   #12
iggyntangs
Scoring Winger
 
iggyntangs's Avatar
 
Join Date: Oct 2010
Exp:
Default

Hmm I don't think I was able to get Arsenal's queries to work properly for me,

I'm having trouble getting my queries to return appropriate results for the following queries though:

1. For a given specific date list the guests that are scheduled to check out, grouped by the villa type; additionally also present their count.

The guest reservation table has the following columns with data: (confirm_no, agent_id, g_name, g_phone)

The reservation table has the following columns with data: (confirm_no, credit_card_no, res_checkin_date, res_checkout_date, default_villa_type, price_plan).


SELECT g_name, default_villa_type
FROM guest_reservation, reservation
WHERE
guest_reservation.confirm_no = reservation.confirm_no
AND res_checkout_date = 24/12/2010
order by default_villa_type, g_name;


SELECT COUNT(*) as total_checking_out
FROM reservation
WHERE res_checkout_date = 24/12/2010

Shouldn't that query work? When I run it, I get NO errors simply no results returned (and the count is 0), and looking at my table I know there should be 2 guest names returning as they checkout that day.

Help?
iggyntangs is offline   Reply With Quote