December 10, 2009 at 8:14 pm
Hi all,
i am developing a resource management system where users can reserve resources like labs, lecture halls.
i have 3 fields for date,time and duration. how to cope with these 3 fields such that there wont happen any ambiguities.
thank you.
December 10, 2009 at 9:55 pm
I wouldn't store a duration. I'd store the start and end times and calculate duration when querying it. The UI can ask for a start time and a duration, but in the database I'd store resource, start_time, end_time and then when someone attempts to reserve a resource you only allow it if there is not an existing row where resource = resource and start_time between start_time and end_time.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 10, 2009 at 10:05 pm
Hello...
thank you for the hint.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply