case-sensitive sort in Access

  • Thread starter Thread starter Guest
  • Start date Start date
Hi, Dave.
How do I peform a case-sensitive sort in Access

Try either of the following syntax:

ORDER BY StrComp(LCase([FieldName]), [FieldName], 0), [FieldName];

This will sort the lower case string values a to z first, followed by upper
case A to Z.

ORDER BY StrComp([FieldName], LCase([FieldName]), 0), [FieldName];

This will sort the upper case string values A to Z first, followed by lower
case a to z.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are (e-mail address removed) and (e-mail address removed)

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that the first and
best answers are often given to those who have a history of rewarding the
contributors who have taken the time to answer questions correctly.
 
Define what the sort should accomplish. Show us sample data and how it
should sort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top