Question : How to write a query in Ms-Access 2007 to compare two fields in two tables?

Hi,
I have two tables in my database named tblMap1, tblMap2. There is a column "FieldValue" in both the tables. The table "tblMap1" has some data in this coulmn as 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 etc and the table "tblMap2" has data in this column as D1, D2, D3, D4, D5, D6, D7 etc.
I need to compare these two columns by appending "D" to the value in the table "tblMap1" and show the data which exists in tblMap1 and does not exist in tblMap2.
The output needs to be 8, 9, 10 from the above example.

Can anybody please help me how to write a Join query for this?
Thanks for any help.

Answer : How to write a query in Ms-Access 2007 to compare two fields in two tables?

My previous post contained a typo:
Query2:
   select * from query1 outer left join tblMap2 on query1.FK = tblMap2.FieldValue where tblMap2.fieldvalue is null
should read
   select * from query1 left outer join tblMap2 on query1.FK = tblMap2.FieldValue where tblMap2.fieldvalue is null


Here's the all-in-one-query version (can't be represented in graphical query builder in Access, so paste into SQL view of query.

SELECT TBLMAP1.FIELDVALUE
FROM tblMap1 LEFT OUTER  JOIN  tblMap2 ON "D" & TBLMAP1.FIELDVALUE  = TBLMAP2.FIELDVALUE WHERE TBLMAP2.FIELDVALUE IS NULL

You can expect it to run slowly compared to most other queries. I think my previous, two query solution would execute faster.
Random Solutions  
 
programming4us programming4us