473,770 Members | 3,710 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Test all records in a many to one linked records

Access 2002:

Example:
Master record: ID#, Name
Linked records: ID#, Member year
If a member for the last 3 years you have 3 linked records withmember year =
2002, 2003, and 2004.
I want to find all ID#'s that were members in 2003 but NOT 2004.
A query for member year = 2003 and <> 2004 yields ALL 2003 records because
the 2003 record = 2003 and NOT 2004.
How can the query look at all the linked records at the same time for a
valid test?

Phil Abrahamsen
ph**@bowersoc.c om

--
----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com
Nov 13 '05 #1
1 1487
In essence, you need to create subselects of the 2003 members and the 2004
members and join them.

The following SQL is untested aircode:

SELECT A.ID, A.[Name]
FROM
(SELECT ID, [Name]
FROM Master INNER JOIN Linked
ON Master.ID = Linked.ID
WHERE Linked.MemberYe ar = 2003) AS A
LEFT JOIN
(SELECT ID, [Name]
FROM Master INNER JOIN Linked
ON Master.ID = Linked.ID
WHERE Linked.MemberYe ar = 2004) AS B
ON A.ID = B.ID
WHERE B.ID IS NULL
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"Phil Abrahamsen" <ph**@abrahamse ns.com> wrote in message
news:d1******** @dispatch.conce ntric.net...
Access 2002:

Example:
Master record: ID#, Name
Linked records: ID#, Member year
If a member for the last 3 years you have 3 linked records withmember year
=
2002, 2003, and 2004.
I want to find all ID#'s that were members in 2003 but NOT 2004.
A query for member year = 2003 and <> 2004 yields ALL 2003 records because
the 2003 record = 2003 and NOT 2004.
How can the query look at all the linked records at the same time for a
valid test?

Phil Abrahamsen
ph**@bowersoc.c om

--
----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com

Nov 13 '05 #2

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

Similar topics

3
9111
by: deko | last post by:
I have a form with a subform datasheet - I need code behind the OnDelete event of the subform: Private Sub Form_Delete(Cancel As Integer) 'do something that depends on which record is deleted End Sub This works okay when only one record is selected and the delete key is pressed (or right-click delete is selected - makes no difference). But if multiple records are selected in the datasheet, the code runs for the first
15
7260
by: brettclare | last post by:
I have linked a large SQL Server table to Access, however 'only' 2,195,439 records are shown and are available to query. Can I increase the size (cache??)/number of records showing in Access? Thank you.
2
2423
by: csgraham74 | last post by:
Hello, im using MS Access as a front end to link to MYSQL. although this is possibly an Access issue i thought someone would be able to help me. the error message "ODBC--insert on a linked table 'tablname' failed" is displayed when i attempt to insert records to the MYSQL table. Does anyone know of a way round this ?? im using the most recent MYSQL driver and i have only text fields in my insert statement.
10
6731
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that contains only tables. I have linked the tables for the front end to the back end database. I am trying to set the recordsource of a form to a query established by the user to narrow the scope but I don't want to display the form if there are no...
4
2216
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that contains the other information. it is set 1 to 1 in the relationships. simplify if I can
6
2776
by: gerbski | last post by:
Hi all, I am relatively new to ADO, but up to now I got things working the way I wanted. But now I've run into somethng really annoying. I am working in MS Access. I am using an Access frontend separately from a backend. The tables from the backend database are linked in the frontend database. In the frontend there is a Form with a listbox in it. The listbox rowsource is a query that selects all the records from a (linked)
3
8086
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we incur numerous service problems “Events”. Each morning we have a global conference call where events which occurred within the previous 24 hours are discussed. Prior to the call, an analyst has to review these events and provide a report, ‘The Morning...
5
2802
by: Neil | last post by:
I'm running Access 2000 with a SQL 7 back end, using ODBC linked tables in an MDB file. The db is used by about 30 users on a LAN, and an additional 10 or so on a WAN. Recently, one of the WAN users complained of intermittently not being able to find certain customers in the customers table (contains around 40,000 records). There are specific "problem records" of customers that can't be found, and they all start with the letter "F" (the...
6
4089
by: scott.tang | last post by:
I'm experiencing a very strange problem. My application is MS Access front-end and MS SQL server back-end database. I have a SQL statement that deletes records from a table after an export process. The problem is occasionally when the delete statement is executed, these records no longer display on List Box (not even in the MS Access link table). But when close and reopen the form, those records reappear. It almost like MS SQL server...
0
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10008
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
6682
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2822
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.