Re: bookings

2004-03-02 Thread Sasha Pachev
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

Re: bookings

2004-03-02 Thread Mark Maggelet
: select sum(seasons.rate) as total,sum(1) as daysbooked from bookings,seasons where bookings.id=$id and seasons.dayofyear BETWEEN DATE_FORMAT(bookingFromDate,%j) AND DATE_FORMAT(bookingToDate,%j) I don't know how you're charging weekly rates, but you could just check if daysbooked=7 and knock

Re: bookings

2004-03-02 Thread Gerald Taylor
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. All replies

Re: bookings

2004-03-02 Thread Kevin Waterson
This one time, at band camp, Mark Maggelet [EMAIL PROTECTED] wrote: I don't know how you're charging weekly rates, but you could just check if daysbooked=7 and knock a percentage off total. I was thinking of having each day of a period charged as the weekly period rate divided by 7. But this

Re: bookings

2004-03-02 Thread Kevin Waterson
This one time, at band camp, Sasha Pachev [EMAIL PROTECTED] wrote: * 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 How would I benifit from a stored procedure? Kind

Re: bookings

2004-03-02 Thread Gerald Taylor
a user inputs booking dates is turn around and say something like insert bookings (bookstart,bookend,rate) VALUES ($start,$stop,OPTIONAL_RATE($start,$stop)) well you'd need to get the syntax right but your application code would be much simpler and the crunching would be done by the DBMS instead

bookings

2004-03-01 Thread Kevin Waterson
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. All replies greatfully recieved

Querying for continuous bookings

2003-09-22 Thread Ville Mattila
Hi there, My problem at this time is following: I have a table of position bookings, having information of a position code, beginning time of the booking and end time: Pos | Begings | Ends APP | 2003-09-30 11:00:00 | 2003-09-30 12:15

Re: Querying for continuous bookings

2003-09-22 Thread Mojtaba Faridzad
this case, you can work more on this query to have the other records and do the search on the final query. - Original Message - From: Ville Mattila [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 22, 2003 10:56 AM Subject: Querying for continuous bookings Hi there, My