Solved

How do you perform a case-sensitive DISTINCT in Microsoft Access 2007?

Posted on 2009-05-05
2
911 Views
Last Modified: 2012-05-06
I have figured out how to do case-sensitive joins with the StrComp() function, but I can't think of the way to filter a list for case-sensitive unique records. I assume it would require some type of self join, but then I end up with duplicates that I don't know how to get rid of. Can somebody provide me with the SQL to do this?
0
Comment
Question by:CWenger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
pcelba earned 50 total points
ID: 24309454
You have to extend the column list in SELECT DISTINCT by some calculated column, e.g.

SELECT DISTINCT YourText, StrToHex(YourText) AS hextext
  FROM ...

The StrToHex() is user defined function (you may find it in Access 2007 help):
Function StrToHex(S As Variant) As Variant
   Dim Temp As String, I As Integer
   
   If VarType(S) <> 8 Then
               
     StrToHex = S
   Else
      Temp = ""
       For I = 1 To Len(S)
          Temp = Temp & Format(Hex(Asc(Mid(S, I, 1))), "00")
       Next I
       StrToHex = Temp
  End If
End Function

Open in new window

0
 

Author Closing Comment

by:CWenger
ID: 31578230
THANK YOU!!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Read text on Table 7 47
Can a Trigger trigger a Trigger? 4 47
calculate running total 8 51
Using Sum with Case When within a query 9 47
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question