Search code examples
ms-accesscapitalizestrconv

How do I capitalize all text in a column of data in an Access Query while keeping the name of the field the same?


How do I capitalize all text in a column of data in an Access Query while keeping the name of the field the same?

I tried entering "SPEC: StrConv([SPEC],3), but I get an error that I have a circular argument (which, isn't too surprising). So how do I get around this?

Is there a totally different approach to capitalizing in queries?


Solution

    • Given: we have a field named [SPEC].
    • Problem: need query to grab [SPEC] and convert it to all caps, but with the same field name
    • Added: We will call the table that holds the field [SPEC], [tblTable]

    Solution: What we need to put in the query builder is the following:

    SPEC: UCase([tblTable].[SPEC])
    

    That way the machine can figure out that Query.SPEC isn't the same identifier as tblTable.SPEC

    Equivalently:

    SELECT UCase([tblNames].[FirstName]) AS FirstName
    FROM tblNames;