Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a Query

Status
Not open for further replies.
Feb 9, 2003
24
AR
I have two tables, Table1 and Table2. Both tables have an account code of xxx-xxxxx-xxxx-xxxx. Every account code is unique. I'm trying to produce a query that will give me a resulting table of all records in Table1 except the records which have a matching account code in Table2. I can't seem to get this to work right and have no idea how to obtain the results I'm lookign for.
 
It's fairly easy to do manually, but the "Find Unmatched Query Wizard" should be able to create that for you.
 
Ok that didn't work. I actually tried that exact SQL statement. I created it by earlier. I thought that should work but it doesn't. Here is the code it created.

SELECT subled_sub.record_number, subled_sub.account_code, subled_sub.maximum_dollar_amount, subled_sub.expended_dollar_amount, subled_sub.pre_encumbered_dollar_amount, subled_sub.encumbrances_after_close, subled_sub.account_type, subled_sub.unused, subled_sub.account_fiscal_year, subled_sub.account_class, subled_sub.department_prefix, subled_sub.department_suffix, subled_sub.description
FROM subled_sub LEFT JOIN subdiv_sub ON subled_sub.account_code = subdiv_sub.account_code
WHERE (((subdiv_sub.account_code) Is Null));

The ouput created from this query is nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top