473,396 Members | 2,057 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.

Query on 2 tables using two fields

Hi,

I have spent a few days on this problem and it is driving me nuts. I have two tables called Parcels and Assessments. Both tables have two fields Printkey and SWIS. I have to join the fields based on the Printkey field plus the SWIS field being equal between the two tables. The SQL statment kind of works but does not grab all the records it is supposed to. It is a homework question but I just need to be pointed in the right direction. Am I even close?

Here is the SQL statement:

SELECT ASSESSMENT.PRKEY, ASSESSMENT.SWIS, ASSESSMENT.OWNER, ASSESSMENT.STREETNUM, ASSESSMENT.STREETNAME, ASSESSMENT.PROPTYPE, PARCELS.AREA
FROM ASSESSMENT INNER JOIN PARCELS ON (ASSESSMENT.SWIS = PARCELS.SWIS) AND (ASSESSMENT.PRKEY = PARCELS.PRINTKEY)
WHERE (([ASSESSMENT]![PRKEY]=[PARCELS]![PRINTKEY] And [ASSESSMENT]![SWIS]=[PARCELS]![SWIS]));
Oct 26 '06 #1
4 1624
NeoPa
32,556 Expert Mod 16PB
That's pretty close to my mind - just lose the whole WHERE clause as it's tautologous (great word that - expresses again what has already been expressed).
The FROM clause with the INNER JOIN will only allow records where the two pairs of fields match from each of the two constituent tables.
Oct 26 '06 #2
NeoPa
32,556 Expert Mod 16PB
Couldn't edit previous post as 5 min limit had expired.

Just wanted to add that the '!'s in the WHERE clause should have been '.'s.
Oct 26 '06 #3
Thanks. I did catch the !. Not Sure how that happened so that is fixed.

Sue
Oct 27 '06 #4
MMcCarthy
14,534 Expert Mod 8TB

tautologous (great word that - expresses again what has already been expressed).
Great word, I like it.

Should be part of the vocabulary of all programmers.
Oct 27 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Paradigm | last post by:
I am using Access 2K as a front end to a MYSQL database. I am trying to run a Union query on the MYSQL database. The query is (much simplified) SELECT as ID from faxdata UNION SELECT as ID ...
6
by: Jeremy Wallace | last post by:
I have a ton of queries that I need users to be able to view. I'd like to have them viewed in a datasheet-view form instead of directly, so that I can keep the users from futzing with the data. ...
0
by: Ellen Ricca | last post by:
I have an Access db with several ODBC linked ORACLE tables. These tables have multiple-field PK's. The tables work just fine in many diff types of queries including unmatched queries that are...
3
by: mkjets | last post by:
I have worked for hours on trying to find a solution and have not figured it out. I am working in Access 2003. I need to create a query that takes values from 1 table and displays them in...
0
by: phlype.johnson | last post by:
I'm struggling to find the best query from performance point of view and readability for a normalized DB design. To illustrate better my question on whether normalized designs lead to more complex...
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
4
by: Doris | last post by:
It does not look like my message is posting....if this is a 2nd or 3rd message, please forgive me as I really don't know how this site works. I want to apologize ahead of time for being a novice...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
3
dlite922
by: dlite922 | last post by:
I'm building a dynamic reporting system. The report can of course query multiple tables. The query declares which tables it will access, the fields that it needs for display, and the dependent...
9
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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,...

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.