473,404 Members | 2,114 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,404 software developers and data experts.

Finding complimentary data sets in MS Access Using Queries

Hello all. I'm an access newbie trying to learn how to do basic
database data manipulations. I had a hard time searching the archives
on this question as I don't really know what I'm looking for in this
case, so please refer me to previous posts that address my question.
Thanks in advance.

My question relates to finding complimentary data sets using queries.
For the sake of discussion, lets say that I have a database that
tracks automobiles for a rental car agency. There are two tables - one
table lists all of the automobiles tracked and the other table lists
associated transactions with the automobiles - when the automobiles
were last serviced, whether or not they are currently rented, whether
or not they have been sold, etc. Now lets say that I want to find out
whether or not an automobile was on my car lot on a particular date. I
define whether or not a car is on the lot by saying that if the car
wasn't rented or the car hadn't been sold prior to that date, the car
must have been on the lot. I can easily build a query to show all the
cars that were rented on that day or sold prior to that date using MS
Access. However, what I want is the complimentary data set; all the
data in the Automobiles table that is NOT in my query.

In other words, if I define all the automobiles in the system as Set
A, and the query that I can build as set B, what I want is the Set C
such that an element is in set C if it is in Set A but not in Set B.
If someone can let me know how to do this using the GUI or SQL view in
access, I'd really appreciate it. Even if it's simply providing the
search terms for me to read up on.

Thanks.
Nov 13 '05 #1
2 1592
On 29 Dec 2004 19:02:59 -0800, us******@hotmail.com (User 2084) wrote:

There are several ways you can do this. Here is one, using the IN
clause:
select * from Automobiles
where AutomobileID not in (select AutomobileID from RentedOrSoldQuery)

-Tom.

Hello all. I'm an access newbie trying to learn how to do basic
database data manipulations. I had a hard time searching the archives
on this question as I don't really know what I'm looking for in this
case, so please refer me to previous posts that address my question.
Thanks in advance.

My question relates to finding complimentary data sets using queries.
For the sake of discussion, lets say that I have a database that
tracks automobiles for a rental car agency. There are two tables - one
table lists all of the automobiles tracked and the other table lists
associated transactions with the automobiles - when the automobiles
were last serviced, whether or not they are currently rented, whether
or not they have been sold, etc. Now lets say that I want to find out
whether or not an automobile was on my car lot on a particular date. I
define whether or not a car is on the lot by saying that if the car
wasn't rented or the car hadn't been sold prior to that date, the car
must have been on the lot. I can easily build a query to show all the
cars that were rented on that day or sold prior to that date using MS
Access. However, what I want is the complimentary data set; all the
data in the Automobiles table that is NOT in my query.

In other words, if I define all the automobiles in the system as Set
A, and the query that I can build as set B, what I want is the Set C
such that an element is in set C if it is in Set A but not in Set B.
If someone can let me know how to do this using the GUI or SQL view in
access, I'd really appreciate it. Even if it's simply providing the
search terms for me to read up on.

Thanks.


Nov 13 '05 #2
Tom:

Thank you very much. This was exactly what I was looking for.
Tom van Stiphout wrote:
On 29 Dec 2004 19:02:59 -0800, us******@hotmail.com (User 2084) wrote:
There are several ways you can do this. Here is one, using the IN
clause:
select * from Automobiles
where AutomobileID not in (select AutomobileID from RentedOrSoldQuery)
-Tom.


Nov 13 '05 #3

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

Similar topics

3
by: crespoh | last post by:
Hi, How do I select data from two tables from two different databases and compare them? using dbi,odbc
4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
3
by: D Denholm | last post by:
I am a Access newbie... Hopefully somebody can help me figure this out. I have a database that looks like: Asset Economic Minimum ----- ---------------- 10555 ...
2
by: Jonathan LaRosa | last post by:
Hi all - I'm wondering if anyone has (or knows of) a tool that will allow me to search through VB code, tables, queries, reports, forms, and other objects, for references to all other types of...
2
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I...
4
by: Oyvind | last post by:
I'm working on a Windows forms/C# database application. My background is 6-7 years of VB 4 - 6, MS Access, VC++, mixed in with a lot of T-SQL and MS SQL Server in general and some OOA/OOD. ...
1
by: Mike Heywood | last post by:
Hi, I am currently trying to automate a process that I have been studying the manual results from for a while. The process simply identifies events that meet certain criteria and at the moment...
17
Motoma
by: Motoma | last post by:
This article is cross posted from my personal blog. You can find the original article, in all its splendor, at http://motomastyle.com/creating-a-mysql-data-abstraction-layer-in-php/. Introduction:...
0
by: ARC | last post by:
I posted previously about a strategy for importing data from a previous database that is in a different version of Access. I'm going with the strategy of having 2 sets of linked tables, one...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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,...
0
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...

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.