Microsoft KB Archive/304258

= ACC2000: How to Find Records That Have Uppercase, Lowercase, or Mixed-Case Data =

Article ID: 304258

Article Last Modified on 7/14/2004

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition

-



This article was previously published under Q304258



Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).



SUMMARY
This article shows you how to create a query that returns records that have the data in a particular case (for example, uppercase, lowercase, or mixed case). For example, assume that the following data is in the table:

AddProperty

address

ADDRESSPAIR

ADDRESSTABLE

AddressToString

andexp

AttachPropertyInstance

AttachPropertyInstanceEx

BERGetHeader

BERGetInteger

BERGetString

BLOB_TABLE

BuildINIPath

Use one of the following methods to find the data in the case that you want.



Method 1: To Find All the Records in a Field That Contain Uppercase Text
 Create a new query in Design view. In the Show Table dialog box, click the table that contains the data, and then click Add. Add the field that contains the data to the query design grid. In the next open Field cell in the query design grid, type or paste the following:

Upper:StrComp(UCase([Field1]), [Field1],0)

 In the Criteria row under Upper, type 0 .

Method 2: To Find All the Records in a Field That Contain Lowercase Text
 Create a new query in Design view.</li> In the Show Table dialog box, click the table that contains the data, and then click Add.</li> Add the field that contains the data to the query design grid.</li> In the next open Field cell in the query design grid, type or paste the following:

Lower:StrComp(LCase([Field1]), [Field1],0)

</li> In the Criteria row under Lower, type 0 .</li></ol>

Method 3: To Find All the Records in a Field That Contain Mixed-Case Text
 Create a new query in Design view.</li> In the Show Table dialog box, click the table that contains the data, and then click Add.</li> Add the field that contains the data to the query design grid.</li> In the next open Field cell in the query design grid, type the following:

Upper:StrComp(UCase([Field1]), [Field1],0)

</li> In the Criteria row under Upper, type <> 0 .</li> In the next open Field cell in the query design grid, type the following:

Lower:StrComp(LCase([Field1]), [Field1],0)

</li> In the Criteria row under Lower, type <> 0 .</li></ol>

Additional query words: inf

Keywords: kbhowto KB304258

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.