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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find records where 2 fields are different 1

Status
Not open for further replies.

blarson0

Programmer
Jun 12, 2002
85
US
Hi! This is probably something really simple, but oh well...
I am trying to write a query that will compare 2 tables and tell me which records have different revision levels. The tables look like this:

Table 1:
assy number
rev number
other data

Table 2:
assy number
job number
rev number
other data

When a new revision of an assembly is put out, it will show up in Table 1. I need to find all the records where the revision numbers do not match, so updating of data can be done. Here is what I currently have:

SELECT DISTINCT [Pick List].JOB, [Pick List].ASSY, [Pick List].REV AS JobRev, [Model Code].Revision AS AssyRev
FROM [Model Code] INNER JOIN [Pick List] ON [Model Code].Assy = [Pick List].ASSY;

what where clause would test if [Pick List].REV <> [Model Code].Assy? Doing WHERE [Pick List].REV <> [Model Code].Assy doesn't return any results.

Thanks!

-Brad
 
I got it to work. Evidently a <> won't work when one of the values is null... putting a &quot; or [Model Code].Revision is null &quot; works just fine.

Thanks!

-Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top