Print Page | Close Window

Storing Dates

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5762
Printed Date: 30 March 2026 at 7:19am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Storing Dates
Posted By: hockenpj
Subject: Storing Dates
Date Posted: 15 September 2003 at 12:26pm

I am in the process of developing a database that will allow me to keep track of my assets (sound equipment).

What I want to be able to do is to be able to see if my equipment is in my warehouse of if it is out on a job.  If it is out on a job then it will be allocated to a customer.

I have more or less figured out how I am going to build it, but I have one problem.  I cannot figure out how I am going to tackle advanced bookings.  For example if I want to book a amplifier for next Monday, then I try to book that same amplifier for next Monday - the database needs to tell me that it has already been allocated.

How can I do this so that I can allocate equipment years in advance?

Please give me your ideas.




Replies:
Posted By: michael
Date Posted: 15 September 2003 at 3:40pm

TableEquipment
EquipmentID
EquipmentType  (e.g. Basedrum, Guitar, Speaker Type 1 etc.)
EquipmentName

TableBookings
BookID
EquipmentID
BookDate


Now if you make a request for let's say Equipmenttype = 'Basedrum' for the date of 09/25/03 you would like you said have to see if it is not already booked, you can do that with a simple query like:
Select * from TableEquipment e JOIN TableBookings b ON e.EquipmentID = b.EquipmentID WHERE NOT b.BookDate = '09/25/03'

This would return all Basedrums that are not booked on that day.
Now you can get keen with all that and I am assuming a lot here as I don't even know if they are in categories.
If you just have a list of equipment that you click and select a date you want to book it, then want to get a warning that the piece is not available for said date you would do pretty much the same ...
Select * from tableequipment e join tablebookings b ON e.equipmentid = b.equipmentid where not b.bookdate = @yoursearchvariablehere

If the bookins have a timespan you just put a between into the query so it searches a timeframe.   



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: hockenpj
Date Posted: 16 September 2003 at 6:20am
Thanks for your help and prompt reply.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net