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



The information in this article applies to:

  • Microsoft Access 2000

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.

MORE INFORMATION

Method 1: To Find All the Records in a Field That Contain Uppercase Text

  1. Create a new query in Design view.
  2. In the Show Table dialog box, click the table that contains the data, and then click Add.
  3. Add the field that contains the data to the query design grid.
  4. In the next open Field cell in the query design grid, type or paste the following:

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

  5. In the Criteria row under Upper, type 0.

Method 2: To Find All the Records in a Field That Contain Lowercase Text

  1. Create a new query in Design view.
  2. In the Show Table dialog box, click the table that contains the data, and then click Add.
  3. Add the field that contains the data to the query design grid.
  4. In the next open Field cell in the query design grid, type or paste the following:

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

  5. In the Criteria row under Lower, type 0.

Method 3: To Find All the Records in a Field That Contain Mixed-Case Text

  1. Create a new query in Design view.
  2. In the Show Table dialog box, click the table that contains the data, and then click Add.
  3. Add the field that contains the data to the query design grid.
  4. In the next open Field cell in the query design grid, type the following:

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

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

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

  7. In the Criteria row under Lower, type <> 0.

Modification Type:MinorLast Reviewed:7/14/2004
Keywords:kbhowto KB304258