If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Question on Query Comparing 2 values
Hello Group,
I have 2 recordsets with the 2 exact same fields. I would like to perform a compound comparison of the 2 fields from each table. That is; compare recordset #1 to recordset #2 and get a returned recordset (recordset #3) that contains records whe - Field #1 from Recordset #1 equals Field #1 from recordset #2 BUT - Excludes records if field #2 from recordset #1 equals field #2 from recordsets #2 I have no idea how to do this, any help is appreciated!!! Thanks!! |
#2
|
|||
|
|||
Question on Query Comparing 2 values
Perhaps you could use something like this:
Dim rs As DAO.Recordset Dim strSql As String strSql = "SELECT T1.* FROM T1 INNER JOIN T2 ON T1.F1 = T2.F1 WHERE T1.F2 F2.F2;" Set rs = dbEngine(0)(0).OpenRecordset(strSql) (I'm not clear how you want to handle the nulls.) -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Joe C" wrote in message ... I have 2 recordsets with the 2 exact same fields. I would like to perform a compound comparison of the 2 fields from each table. That is; compare recordset #1 to recordset #2 and get a returned recordset (recordset #3) that contains records whe - Field #1 from Recordset #1 equals Field #1 from recordset #2 BUT - Excludes records if field #2 from recordset #1 equals field #2 from recordsets #2 |
#3
|
|||
|
|||
Question on Query Comparing 2 values
On Jul 10, 11:36*am, "Allen Browne"
wrote: Perhaps you could use something like this: Dim rs As DAO.Recordset Dim strSql As String strSql = "SELECT T1.* FROM T1 INNER JOIN T2 ON T1.F1 = T2.F1 WHERE T1..F2 F2.F2;" Set rs = dbEngine(0)(0).OpenRecordset(strSql) (I'm not clear how you want to handle the nulls.) -- Allen Browne - Microsoft MVP. *Perth, Western Australia Tips for Access users -http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Joe C" wrote in message ... I have 2 recordsets with the 2 exact same fields. *I would like to perform a compound comparison of the 2 fields from each table. *That is; compare recordset #1 to recordset #2 and get a returned recordset (recordset #3) that contains records whe - *Field #1 from Recordset #1 equals Field #1 from recordset #2 BUT - *Excludes records if field #2 from recordset #1 equals field #2 from recordsets #2- Hide quoted text - - Show quoted text - Thanks! This did the trick !!! |
Thread Tools | |
Display Modes | |
|
|