mfaqueiroz
New Member
- Joined
- Sep 30, 2015
- Messages
- 5
Hi, everyone!
I need an query that finds duplicate values in the column state but at same time the code of this records has to be different.
So my query should give me only the bold values...
<tbody>
</tbody>
<tbody></tbody>
I tried to use the vba, but didn't worked...
Option Compare Database
Dim qdf As DAO.QueryDef
Dim StrSQL As String
Set qdf = CurrentDb.QueryDefs("LMt")
StrSQL = "In (SELECT [State] FROM [Tb_A] As Tmp GROUP BY [State] HAVING Count(*)>1 )" And "In (SELECT
I need an query that finds duplicate values in the column state but at same time the code of this records has to be different.
So my query should give me only the bold values...
State | Code |
Open | 3 |
Open | 3 |
Close | 4 |
Close | 6 |
Open | 5 |
<tbody>
</tbody>
<tbody></tbody>
I tried to use the vba, but didn't worked...
Option Compare Database
Dim qdf As DAO.QueryDef
Dim StrSQL As String
Set qdf = CurrentDb.QueryDefs("LMt")
StrSQL = "In (SELECT [State] FROM [Tb_A] As Tmp GROUP BY [State] HAVING Count(*)>1 )" And "In (SELECT
Code:
FROM [Tb_dispprotfinal] As Tmp GROUP BY [Code] HAVING Count(*)<>1 )"
qdf.SQL = StrSQL
Set qdf = Nothing
Could someone help me?
:)
I really appreciate your time,
thank you