web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Querying case sensitive data

(0) ShareShare
ReportReport
Posted on by

Hi

We have a table that we use to fix names of new customers. 

We take the different parts of the name and match it against this table. E.g. we transform "Von" to "von".

However, we have a problem right now. We have two values containing the same characters, but with different casing. In this case, we want "AF" to be translated into "af", but "af" should be translated into "Af"(nevermind the reason for this seemingly strange logic, but we have a good reason)

When I query the table for the value "af" I get the record with value "AF" in return, i.e. not the record that I was looking for.

Is it possible to make this query case sensitive?

/Jonas 

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Lauras U Profile Picture
    955 on at

    You can try strCmp Function. The comparison performed by this method is case-sensitive.

    Read more at:

    msdn.microsoft.com/.../aa672979.aspx

  • Verified answer
    Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Your DB ingores case because its collation is set to "case-insensitive".

    You could change a collation for your query (see COLLATE in T-SQL, if you're using SQL Server), but I don't expect any support for it in X++, so you would have to use SqlStatement class or deal with it directly on the DB level.

    Another solution would be to ignore case during fetching and do a case-sensitive comparison on the application layer.

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Small correction: the class is named "Statement", not "SqlStatement"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans