473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List box to list the opposite of a query

I really need some help with the following problem if anyone would be
willing.

I need a list box to list the opposite of what appears in a query.
Heres the details:

My database is for a doctors surgery, and this includes the tables
tblPatients, tblDoctors and tblAppointments . tblAppointments has an
Appointment ID and also includes the Patient ID (from tblPatient) and
Doctor ID (from tblDoctor) plus the start and end time of the
appointment.

tblAppointment( APPOINTMENT_ID, patient ID, Doctor ID, start time, end
time)

What I want to do is create a list box that lists all the Doctor ID's
for doctors who do not have an appointment at a given time. this time
is determined when the user types in a start and end time on a form. I
have created a query which lists all the Doctor ID's that do have an
appointment at that time. this query is based on the tblAppointment.
what I now want to do is create a list box that will list all the
Doctor ID's that do not appear in this query.

Sounds pretty basic stuff I know, but I've been trying for days with
NOT arguments and many other methods, but had no success.
Nov 13 '05 #1
2 2194
rkc
ormy28 wrote:
I need a list box to list the opposite of what appears in a query.
Heres the details:

My database is for a doctors surgery, and this includes the tables
tblPatients, tblDoctors and tblAppointments . tblAppointments has an
Appointment ID and also includes the Patient ID (from tblPatient) and
Doctor ID (from tblDoctor) plus the start and end time of the
appointment.

tblAppointment( APPOINTMENT_ID, patient ID, Doctor ID, start time, end
time)

What I want to do is create a list box that lists all the Doctor ID's
for doctors who do not have an appointment at a given time. this time
is determined when the user types in a start and end time on a form. I
have created a query which lists all the Doctor ID's that do have an
appointment at that time. this query is based on the tblAppointment.
what I now want to do is create a list box that will list all the
Doctor ID's that do not appear in this query.


You haven't posted your query so I'll just post an example based on
the Employees table of the Northwind database. Basically you select all
the DoctorID's from the Doctor table that aren't returned by the
query you already have working.

SELECT Employees.Emplo yeeID
FROM Employees
WHERE EmployeeID Not IN
(
SELECT Employees.Emplo yeeID
FROM Employees
WHERE Employees.Emplo yeeID=1
)
Nov 13 '05 #2
I would consider this option to simplify things:

Set up a table of appointment slots in 15 minute intervals, or whatever may
be appropriate in your office. I'm assuming that the appointments are of
long enough daration, and of a duration that cannot be pre-determined, such
that you would not typically have appointment times of "2:35 pm - 2:45 pm" ,
but that your appointments would be more on the order of 15 minute or
half-hour increments. So you might have a table like:

appt_slot_ id as_start_time as_end_time
1 8:00: AM 8:15 AM
2 8:15 AM 8:30 AM

etc.

Then, your tblAppointemnt is not dealing with times, just the IDs, which
will simplify your queries. Further, If you can eliminate the user entering
invalid times, then I would (using a combobox rahter than textbox). Of
course this would create a restriction from entering appointment times at
odd intervals - no 2:35 appointments. This may not be acceptable, so this
may not be useful.

Darryl Kerkeslager
"ormy28" <ma*******@hotm ail.com> wrote:
I really need some help with the following problem if anyone would be
willing.

I need a list box to list the opposite of what appears in a query.
Heres the details:

My database is for a doctors surgery, and this includes the tables
tblPatients, tblDoctors and tblAppointments . tblAppointments has an
Appointment ID and also includes the Patient ID (from tblPatient) and
Doctor ID (from tblDoctor) plus the start and end time of the
appointment.

tblAppointment( APPOINTMENT_ID, patient ID, Doctor ID, start time, end
time)

What I want to do is create a list box that lists all the Doctor ID's
for doctors who do not have an appointment at a given time. this time
is determined when the user types in a start and end time on a form. I
have created a query which lists all the Doctor ID's that do have an
appointment at that time. this query is based on the tblAppointment.
what I now want to do is create a list box that will list all the
Doctor ID's that do not appear in this query.

Sounds pretty basic stuff I know, but I've been trying for days with
NOT arguments and many other methods, but had no success.

Nov 13 '05 #3

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

Similar topics

8
5790
by: simpleman | last post by:
Hi, I have an assignment that requires me to subtract two very large unsigned integers using linked list.AFAIK I have to manipulate data as character. But I dont know how to get input into the linked list since the input will all be in one line. eg. 1234567890. Also I have to use one integer per node. Any help/suggestion will be greatly...
2
2269
by: Waxabi X | last post by:
I created a view on an Access 2002 database through an ODBC query tool. The view works fine either through ODBC or the Access IDE. The problem I am having is that it does not show up in the Queries list on the Access IDE. It's almost as if ODBC did not write a portion of the data dictionary or something.. quite odd. Has anyone heard of this...
6
7392
by: bradleyp | last post by:
Hi all, I have a table (tblCodes) that has two fields: 'ID' and 'Code'. A small portion of the table is as follows: |-------------| | tblCodes | |-------------| | ID | Code | |------|------|
4
2922
by: dssuresh6 | last post by:
Whether browsing forward or backward can be done using a singly linked list. Is there any specific case where a doubly linked list is needed? For people who say that singly linked list allows traversal only in one direction, I would say that using appropriate loops/recursion, traversal in opposite direction is also possible. Then why the need...
44
3842
by: Josh Mcfarlane | last post by:
Just out of curiosity: When would using std::list be more efficient / effective than using other containers such as vector, deque, etc? As far as I'm aware, list doesn't appear to be specialized for anything. Thanks, Josh McFarlane
17
6202
by: shades234 | last post by:
I saw a post about a year ago, that pondered if an opposite to a union query was possible, i.e. an intersect query. however, the OP was concerned about varous fields intersectiong with one another. i have a different approach. i have a table of records. there is a date field a start time field and an end time field. (not together, due to...
3
1229
by: Geethu03 | last post by:
Hi I am writing a query to list some fields in asc,and desc.i want to list the field in my won order. that is my filed name is Status, in this i stored a values High, Low and Medium. I am able to sort this field in asc and desc but i want list in High,Medium and Low and also the opposite way that is Low,Medium and High. How can i do this ...
7
1436
by: macca | last post by:
You don't have to use DISTINCT on the full date, for example to get the distinct months use something like: SELECT DISTINCT MONTHNAME(date_field) AS Months or a PHP solution may use the array_unique() function on your db result set
1
2226
by: Zhang Weiwu | last post by:
I know the subject line is really bad. Here is the real question: we have a web application that lists 1200 products. The web page present only 12 products at once, if you wish to see the next 12 products, click next page or the page index. This is a very common case. e.g. (use fixed-width font for the following) ... Product A ...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.