473,396 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Making a date unavailable

Not sure if this is possible but I am working on a database, that
requires the following function. Be able to book a job in for a given
week of the year, and this then becomes unavailable for anyone else to
book the same week.
I need to be able to do this for multiple people, so they do not get
double booked for jobs.

Anybody got any ideas.

Oct 30 '06 #1
2 1369
How about a table with fields of WeekOfYear, Employee, Booked, BookedFor
You would populate the db fields of WeekOfYear and Employee. Also
initialize Booked to False And BookedFor to "". As you book a week for an
employee change Booked to True and fill in Booked For with the
purpose/Client.
You could then query for weeks available for employee X.

In the alternative you could just record the bookings ( all fields) as they
occur and do some dateMath to figure out what is open.
"feeman" <fe*********@feehally128.karoo.co.ukwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Not sure if this is possible but I am working on a database, that
requires the following function. Be able to book a job in for a given
week of the year, and this then becomes unavailable for anyone else to
book the same week.
I need to be able to do this for multiple people, so they do not get
double booked for jobs.

Anybody got any ideas.

Oct 30 '06 #2

feeman wrote:
Not sure if this is possible but I am working on a database, that
requires the following function. Be able to book a job in for a given
week of the year, and this then becomes unavailable for anyone else to
book the same week.
I need to be able to do this for multiple people, so they do not get
double booked for jobs.

Anybody got any ideas.
I would start by reading Albert Kallal's notes on this. He's done a
LOT of the heavy lifting for you. If you are _always_ booking full
days, then this is simple. This works if your rule is:

A person can be assigned at most one job for a single week of the year.

If you have a table
tblBooking(PersonID, WeekNo, Year)

'--apologies for the Oracle syntax, but you get the idea)
CREATE TABLE Booking(
PersonID INTEGER NOT NULL,
WeekNo INTEGER NOT NULL,
Year INTEGER NOT NULL,
PRIMARY KEY (PersonID, WeekNo, Year),
FOREIGN KEY PersonID REFERENCES People(PersonID)

Then the compound primary key creates a unique index (no duplicates) on
the 3 fields. So you can't insert a duplicate no matter how hard you
try. So once the date is chosen, you can't choose it again. You could
also use comboboxes that get their data from select queries that
eliminate unavailable days. Depends on how your form is set up.

Oct 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Motherchucker | last post by:
I'm running FreeBSD and trying to install mod_php4-4.3.3 from an updated ports tree. When it tries to fetch libtool-1.4.3.tar.gz, I get the following output and it eventually fails. I ended up...
4
by: Raven | last post by:
Using either MySQL functions or PHP, how can I convert a date filed in the format of (varchar) Aug 10, 1950 to a unix timestamp? tia
11
by: Rick | last post by:
I am going crazy on how to format a simple date. I have this in my MySQL table. "2005-03-10 08:44:21" and I want it to format out like "3/10/2005" or "03/10/05" but I seem to be going at it the...
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
7
by: Nimmy | last post by:
Hi, I have a file which has different dates, I want to scanf them as CHAR and convert them to DATE format, how can I do this? Thanks
3
by: Peteroid | last post by:
Is it possible to make a public parent class method unavailable (i.e., generate an error at compile time) to a particular child class? For example, say a parent class has a public method Add( )....
2
by: Petr PALAS | last post by:
Hi, when I open ANY ASP.NET application on my computer I get this message: ---------------------------------------------------------------------------- ---- Server Application Unavailable ...
3
by: Will | last post by:
Is there a good article - or maybe a good chapter in a book - that someone can recommend on the topic of how to make cookie handling secure? I'm interested in common techniques for: -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.