Kevin Waterson wrote:
I am (trying) to make a booking systems.
Currently I have a table with 3 timestamps that record
bookingDate, bookingFromDate and bookingToDate

I have another table that records 'seasons'.
This table contains two timestamps that record
seasonStartDate and seasonEndDate
also I have the rates as seasonRateWeekly and seasonRateNightly

What I need to do, is INSERT INTO bookings the bookingFromDate and
bookingToDate, no problem there, but I need to know what rate to charge them. and if the booking dates overlap seasons, the appropriate
rate needs to be applied.

Kevin:


You have several options:

* do it in the application logic
( write a UDF or a static MySQL function to do the computation
* if your application is not going to be deployed for a year or so or if you have enough confidence in MySQL alpha, use stored procedures in the bleeding edge MySQL 5.0


--
Sasha Pachev
Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to