I have a query that checks for duplicate records on 2 fields. the issue I am having is that the data unfortunately is case sensitive. So M != m but the query is case insensitive. Is there a way to make my query case sensitive so I can cancel out the False positives from the query?
here is the quey if that helps -
SELECT tblPreReleaseData.From_Conn, tblPreReleaseData.From_term, tblPreReleaseData.Serial_number, tblPreReleaseData.Drawing_Number, tblPreReleaseData.Wire_number, tblPreReleaseData.Revision
-
FROM tblPreReleaseData
-
WHERE (((tblPreReleaseData.From_Conn) In (SELECT [From_Conn] FROM [tblPreReleaseData] As Tmp GROUP BY [From_Conn],[From_term] HAVING Count(*)>1 And [From_term] = [tblPreReleaseData].[From_term])))
-
ORDER BY tblPreReleaseData.From_Conn, tblPreReleaseData.From_term;
-
-
any help is appreciated
CG
11 2390
I have a query that checks for duplicate records on 2 fields. the issue I am having is that the data unfortunately is case sensitive. So M != m but the query is case insensitive. Is there a way to make my query case sensitive so I can cancel out the False positives from the query?
here is the quey if that helps -
SELECT tblPreReleaseData.From_Conn, tblPreReleaseData.From_term, tblPreReleaseData.Serial_number, tblPreReleaseData.Drawing_Number, tblPreReleaseData.Wire_number, tblPreReleaseData.Revision
-
FROM tblPreReleaseData
-
WHERE (((tblPreReleaseData.From_Conn) In (SELECT [From_Conn] FROM [tblPreReleaseData] As Tmp GROUP BY [From_Conn],[From_term] HAVING Count(*)>1 And [From_term] = [tblPreReleaseData].[From_term])))
-
ORDER BY tblPreReleaseData.From_Conn, tblPreReleaseData.From_term;
-
-
any help is appreciated
CG
change the fields to UCase([yourfield])
makes everything upper case
Rabbit 12,516
Recognized Expert Moderator MVP
change the fields to UCase([yourfield])
makes everything upper case
Actually, they want the opposite of this, a case sensitive compare.
Use StrComp(string1, string2, compare) where compare = 0 or vbBinaryCompare. If they match completely it'll return 0
change the fields to UCase([yourfield])
makes everything upper case
thank you for your response, but what I am trying to do is to make sure not to capture the data that the only difference is the casing of the values. for example
record1
Field1= 1234
Field2=m
record2
Field1=1234
Field2=M
Record3
Field1=1234
Field2=m
what I need is
Record1 = Record3
but Record1 <> Record2 or Record2<>Record3
I hope this helps
CG
Actually, they want the opposite of this, a case sensitive compare.
Use StrComp(string1, string2, compare) where compare = 0 or vbBinaryCompare. If they match completely it'll return 0
thank you is there a way I can add this to my sql query and if so where would it go or do I have to run this after my original query has run?
CG
Rabbit 12,516
Recognized Expert Moderator MVP
Now that I think about it, StrComp won't work. I don't see a way to implement it. I also tried looking for a global setting you can use but I came up empty there as well. Google search didn't come up with anything either.
The only thing I can think of now is to write a procedure to recode the string as ASCII values.
NeoPa 32,556
Recognized Expert Moderator MVP
Are you saying that
also finds records where [Field] = 'm'?
Now that I think about it, StrComp won't work. I don't see a way to implement it. I also tried looking for a global setting you can use but I came up empty there as well. Google search didn't come up with anything either.
The only thing I can think of now is to write a procedure to recode the string as ASCII values.
like this? -
Function fGetASCII(varText) As String
-
-
Dim varTemp
-
Dim intLoop As Integer
-
Dim intTemp As Integer
-
-
Const cDelim = "."
-
-
If IsNull(varText) Then
-
Exit Function
-
End If
-
-
varTemp = StrConv(varText, 64)
-
For intLoop = 1 To Len(varTemp)
-
intTemp = Asc(Mid(varTemp, intLoop, 1))
-
If intTemp > 0 Then
-
fGetASCII = fGetASCII & cDelim & intTemp
-
intTemp = 0
-
End If
-
Next
-
-
fGetASCII = Mid(fGetASCII, 2)
-
-
End Function
-
Rabbit 12,516
Recognized Expert Moderator MVP
like this? -
Function fGetASCII(varText) As String
-
-
Dim varTemp
-
Dim intLoop As Integer
-
Dim intTemp As Integer
-
-
Const cDelim = "."
-
-
If IsNull(varText) Then
-
Exit Function
-
End If
-
-
varTemp = StrConv(varText, 64)
-
For intLoop = 1 To Len(varTemp)
-
intTemp = Asc(Mid(varTemp, intLoop, 1))
-
If intTemp > 0 Then
-
fGetASCII = fGetASCII & cDelim & intTemp
-
intTemp = 0
-
End If
-
Next
-
-
fGetASCII = Mid(fGetASCII, 2)
-
-
End Function
-
Yeah, something like that. I haven't tried it but why do you use Mid at the bottom?
Yeah, something like that. I haven't tried it but why do you use Mid at the bottom?
Rabbit,
it was used as part of a solution to join two tables...I forgot to take it out.
J
NeoPa 32,556
Recognized Expert Moderator MVP
Nice work J.
I see we're keeping you busy :) I hope you're enjoying things here.
Nice work J.
I see we're keeping you busy :) I hope you're enjoying things here.
Thanks Neo,
I am having fun..pitching in where I can :o)
J
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Giloosh |
last post by:
Hello, i need some help if possible...
i have a payments table with over 500 records
i want to run a query that searches through the table spotting out any
duplicate ID#'s and Dates.
So basically...
|
by: Rado |
last post by:
Hi All,
This might quite simple process for some but I am finding it really
difficult to do. What is required is not a standard Duplicate query but a
variation on it. For example I have...
|
by: Robert |
last post by:
How can I query an existing table and update a field in each record in the
table with the occurrence count of each record e.g. update field to 1 (=
first record occurrence), update field to 2 for...
|
by: ms |
last post by:
Access 2000:
I am trying to delete duplicate records imported to a staging table leaving one
of the duplicates to be imported into the live table. A unique record is based
on a composite key of 3...
|
by: Ross |
last post by:
i have less hair now than i used to...i have a database with many
duplicate records in it with only one exception, there is one field
with the date it was put in the database and that is different....
| |
by: sara |
last post by:
I have a procedure to automate bringing several Excel files into our
Access tables, on a daily basis.
The problem is that if the user has a problem, and tries to run the
import again (maybe 3...
|
by: JG |
last post by:
I have an Access 2000 database with a query in it that is pulling data
from a table that has duplicate records in it. It is doubling my
currency out put. To get rid of the duplicate records in the...
|
by: nethravathy |
last post by:
Hi,
The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not.
I tried with following query
1)SELECT...
|
by: colin-whitehead |
last post by:
I have 2 tables
tblReports primary key UPN, plus numeric fields Effort, Attain, etc
tblComments numeric primary key ID & textfield Text
In the Query I select each record from tblReports...
|
by: xraive |
last post by:
I have a problem with this. Currently I am trying Allen's code and i am not successful.
Current Design
Table1 (Main Form)
TravelID (PK)
ApprovedBY
EntreredBy
BudgetCode
ExpenseCode
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |