mfaqueiroz
Registered User.
- Local time
- Today, 08:53
- Joined
- Sep 30, 2015
- Messages
- 125
Query ! Duplicate records in column "x" and the values recorded in the respective col
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...
State Code
Open 3
Open 3
Close 4
Close 6
Open 5
I tried to use the vba, but didn't worked...(i used the followed code)
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
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...
State Code
Open 3
Open 3
Close 4
Close 6
Open 5
I tried to use the vba, but didn't worked...(i used the followed code)
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