473,394 Members | 1,893 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,394 software developers and data experts.

Query design question

MLH
I have tblClusters containing names of corporations. I have tblAdmin
containing individual store names. Each cluster can have many stores
in tblAdmin. I have tblVehicleJobs containing automobile records.
Each store in tblAdmin can have many related records in tblVehicleJobs

tblClusters has ClusterID as its keyfield. tblAdmin has TowCoID as its
keyfield and ClusterID as a link field to tblClusters. tblVehicleJobs
has VehicleJobID field as its keyfield and TowCoID as a link field to
the vehicles table.

Whew! Having said that, the vehicles table has a boolean field named
[BilledOut]. What I want to do is extract a dynaset showing each
Cluster for which at least 1 vehicle in the vehicles table has a
[BilledOut] field value of False.

In other words, if I had a hundred corporations in the Clusters table,
but there were only 3 vehicles in the vehicles table having a
[BilledOut] field value of False, I would want to see ONLY those
corporations in the dynaset related to those 3 cars. Can this be done?
Apr 14 '07 #1
1 1123
MLH
I think I've got it, but I'd like a second opinion...

SELECT DISTINCT tblClusters.ClusterName
FROM (tblClusters INNER JOIN tblAdmin ON tblClusters.ClusterID =
tblAdmin.ClusterID) INNER JOIN tblVehicleJobs ON tblAdmin.TowCoID =
tblVehicleJobs.TowCoID
WHERE (((tblVehicleJobs.VehicleJobID) Is Not Null) AND
((tblVehicleJobs.BilledOut)=False))
ORDER BY tblClusters.ClusterName;

Apr 14 '07 #2

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

Similar topics

15
by: GTi | last post by:
I have a query like: SELECT "ProjectMembers"."RoleText", "ProjectMembers"."Description", "ContactTable"."Name1", "ContactTable"."Name2", "ContactTable1"."Name1", "ContactTable1"."Name2" FROM...
6
by: Ryan | last post by:
I came across a situation that I've been unable to explain and was hoping somebody had an answer: I had written an update query which was taking about 8 seconds to run and considered it too...
2
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out...
6
by: NB | last post by:
Hi Is there any way to call up the query design view from code? In my compiled-as-MDE app everything is hidden from end users. However, I want advanced user to have access to the query design...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
3
by: c tom | last post by:
id name location 1 tom new york 2 jeny sicago 3 tom new york 4 luca sidney 5 luca sidney i want to make below table using query. id name location
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
7
by: John Øllgård Jensen | last post by:
Hi Using MS Asccess 2000: In a query I'm trying to create a new field with following expression: FilmDate: Left(,4) The field "FilmNo" is another text field in the query. This is...
3
by: Richard Hollenbeck | last post by:
I am very sorry about the (almost) re-post, but you will see that my first question wasn't very clear; I have another question I posted this morning called, "in DAO: Run time error 3061 Too few...
3
by: KNN | last post by:
Hi I have some tables with hidden attribute set to 1. In the query desgn view , I do not see these tables as expected. But, If I choose the query wizard to create a new query, then i do see...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.