AlexN
Registered User.
- Local time
- Today, 22:02
- Joined
- Nov 10, 2014
- Messages
- 302
Hi everyone,
Here I am again with a really tough brain teaser.
We have some events going on, in which Customers (tblCustomers), rent Seats (tblSeats) to attend the event, paying a daily Rate (tblRates) who’s Min and Max values are being predefined by the user, according to Seat Category (tblSeatCategories) and season of the year (tblSeasons). So daily Rates for the same Seat, vary through the year according to Seasons. Seasons are also being predefined by the user and, we want users to be able to set their own seasons every time necessary, as well as keep track of older ones.
Then we have Rentals (tblRentals) that hold information like, when a seat was rented (RentalStart-RentalEnd), by whom (CustomerID), which Seat was rented (SeatID) and subsequently its category, and at what Rate (RentalRate). This Rate has to be a value between Min and Max values predefined in tblRates for the Seat(-> SeatCategory) rented and for the Season, and it’s an input by the user during the (let’s say) “booking” process.
So, user has to have the Rates information for Seat Category and Season on display, during the “booking” process, to decide the Rate.(presumably a query-based subform or a recordsource setting piece of vba code.). We want a subform that would show Min and Max rates for the given Seat Category, and for the given Season that’s calculated after RentalStart and RentalEnd inputs. We also want that subform to show the numbers of days the Rental lasts (multiple durations if multiple seasons).
When Rental’s duration is within the date limits of a single season that’s easy. Even when rental exceeds the date limits of a single season and continuous for the next one, that info is easily calculated (done). But…
Problem is…
There will be times that a rental will (eg) start middle of season 1, last the whole season 2, and end middle season 3 (or even some seasons later). I can count the days within first season, can count the days within last season, but can’t (trying for over a week) find a way to count the days in between (Season's duration doesn't have to be standard).
Any ideas?
Posting a sample piece of a database for anyone who decides to bother.
Thanks in advance
Here I am again with a really tough brain teaser.
We have some events going on, in which Customers (tblCustomers), rent Seats (tblSeats) to attend the event, paying a daily Rate (tblRates) who’s Min and Max values are being predefined by the user, according to Seat Category (tblSeatCategories) and season of the year (tblSeasons). So daily Rates for the same Seat, vary through the year according to Seasons. Seasons are also being predefined by the user and, we want users to be able to set their own seasons every time necessary, as well as keep track of older ones.
Then we have Rentals (tblRentals) that hold information like, when a seat was rented (RentalStart-RentalEnd), by whom (CustomerID), which Seat was rented (SeatID) and subsequently its category, and at what Rate (RentalRate). This Rate has to be a value between Min and Max values predefined in tblRates for the Seat(-> SeatCategory) rented and for the Season, and it’s an input by the user during the (let’s say) “booking” process.
So, user has to have the Rates information for Seat Category and Season on display, during the “booking” process, to decide the Rate.(presumably a query-based subform or a recordsource setting piece of vba code.). We want a subform that would show Min and Max rates for the given Seat Category, and for the given Season that’s calculated after RentalStart and RentalEnd inputs. We also want that subform to show the numbers of days the Rental lasts (multiple durations if multiple seasons).
When Rental’s duration is within the date limits of a single season that’s easy. Even when rental exceeds the date limits of a single season and continuous for the next one, that info is easily calculated (done). But…
Problem is…
There will be times that a rental will (eg) start middle of season 1, last the whole season 2, and end middle season 3 (or even some seasons later). I can count the days within first season, can count the days within last season, but can’t (trying for over a week) find a way to count the days in between (Season's duration doesn't have to be standard).
Any ideas?
Posting a sample piece of a database for anyone who decides to bother.
Thanks in advance