Others

How to Capitalize the Second Word in an MS Access SQL String

Kushani NimanthikaKushani Nimanthika Nov 2, 2026 869 views

Question details

The user needs to convert only the second word of a multi-word string to uppercase while leaving the rest of the text in its original case format.

How to Capitalize the Second Word in an MS Access SQL String
Product
MS Access SQL
Device & OS
not provided
Scenario
Formatting text fields in a database query where a specific word within a string must be targeted for capitalization.
Observed behavior
The text requires dynamic extraction and uppercase conversion of specifically the second word based on space delimiters.
Before you start

Verify that your target text field consistently contains at least two words separated by standard spaces to prevent function errors when searching for the space delimiter.

Solution 1Recommended

Use Built-in MS Access SQL String Functions

Use a combination of Left, Mid, InStr, and UCase to isolate and capitalize the second word directly in your SQL query.

This method uses native MS Access SQL string functions to locate the first and second spaces. It preserves the text before the first space, applies the uppercase conversion to the extracted second word, and appends the remainder of the text.

1
Identify your target field

Open your MS Access database and navigate to the Query Design view where you want to apply the formatting. Identify the exact name of the field containing your text.

2
Apply the formatting expression

In a new column of the query design grid, paste the following expression, replacing 'FieldName' with your actual field name: Left([FieldName], InStr(1, [FieldName], " ")) & UCase(Mid([FieldName], InStr(1, [FieldName], " ") + 1, InStr(InStr(1, [FieldName], " ") + 1, [FieldName], " ") - InStr(1, [FieldName], " ") - 1)) & Mid([FieldName], InStr(InStr(1, [FieldName], " ") + 1, [FieldName], " "))

3
Run the query

Click the 'Run' button in the Query Design ribbon to execute the query and view the results with the second word capitalized.

Use Built-in MS Access SQL String Functions
Data Consistency: This expression assumes standard single-space delimiters. If your data contains double spaces or irregular spacing, consider sanitizing the data using the Replace function first.
Free Microsoft Office alternative

Manage Your Data Effortlessly with WPS Office

While Microsoft Access handles complex SQL database queries, WPS Spreadsheet offers powerful, user-friendly text manipulation formulas for everyday data management without requiring SQL coding. Enjoy a lightweight, free alternative to Microsoft Office that easily handles text formatting.

Free and lightweight Office suiteFully compatible with Microsoft Excel (.xlsx) formatsRich set of built-in text functions (UPPER, MID, FIND) for easy string manipulationFamiliar user interface for seamless migration
microsoft office alternative - wps office

Frequently Asked Questions

What happens if the string only contains one word?

If the string lacks a second word, the InStr function will not find a space, which will result in an 'Invalid Procedure Call' error. It is recommended to wrap the expression in an IIf() statement to check if InStr() > 0 before applying the formatting.

Can I capitalize the third word instead using this method?

Yes, you can adjust the InStr starting positions to locate the second and third spaces instead of the first and second, then apply UCase to the text extracted between those updated positions.

Is there a simpler way to do this in WPS Spreadsheet?

Yes, in WPS Spreadsheet you can use the Text to Columns feature to quickly split the text by spaces, capitalize the second column using the UPPER() function, and concatenate the text back together using the CONCATENATE() function or the '&' operator.