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

Okay I was able to figure that out (it was because of the timestamp that was involved with the day I didn't realize therefore the quotes always gave me an error, so I broke it down by year, month and day and it seemed to register that change quite well).

The last query I need help with is for a specific reservation show the tentative cost the guest will have to pay.

Now this is a bit more complicated because there are two costs, one is the cost for the duration of their stay and the other is for another invoice they get billed to them from another invoice (which is for things such as dining during their stay).

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)

The invoice table has the following columns with data: (inv_no, inv_date, inv_amount, confirm_no).

The price plan table has the following columns with data: (price_plan, rate, default_villa_type, bed_type)

So I need to somehow list the guests name with their total amount due which will be the ((res_checkout_date-res_checkin_date) * rate) + inv_amount coming from the reservation table, price table and invoice table respectively (and the guest name from the guest reservation table which is linked through the confirm_no).

It seems complicated and I'm not even sure where to begin...I tried looking at your model Arsenal for it but I got confused by it and the logic involved I'm sorry I am quite new to this I apologize.
iggyntangs is offline   Reply With Quote