Capital/Small Letters in Text

  • Thread starter Thread starter selene
  • Start date Start date
S

selene

Hallo
I have a problem with text format.
A lookup-table contains textstrings 003A and 003a. Access2003 does not
differentiate between these. But actually they code different things.
What shoul I do?
Thank you for help
 
You can use the Chr function to differentiate between the two. Chr function
uses the ASCII value of a character to return the actual character.

This query will find the one with capital A:

SELECT *
FROM TableName
WHERE FieldName = '003A' And
Right(FieldName, 1) = Chr(65);


This one will find the one with small a:

SELECT *
FROM TableName
WHERE FieldName = '003A' And
Right(FieldName, 1) = Chr(97);
 
Might be a little simpler to use

SELECT *
FROM TableName
WHERE StrComp([FieldName], '003A', 0) = 0

or

SELECT *
FROM TableName
WHERE StrComp([FieldName], '003a', 0) = 0
 

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

Back
Top