How to Find Special Characters and Spaces in Part Numbers
Question details
The user needs to accurately search for part numbers that contain symbols, punctuation, spaces, or other special characters without encountering wildcard, date, or invalid-criteria formatting errors.

- Product
- Database Management / Spreadsheets
- Device & OS
- not provided
- Scenario
- Searching and validating part numbers containing special characters or spaces within a database query or spreadsheet.
- Observed behavior
- Standard queries may misinterpret special characters as wildcards or automatically format them as dates, resulting in invalid-criteria errors or incorrect search results.
Ensure your part number column or field is strictly formatted as 'Text' rather than 'Number' or 'General', as this prevents the system from automatically converting your entries into dates or mathematical formulas.
Use a Text Field and Escape Wildcard Characters
Format your data field as Text and properly escape special characters to prevent them from acting as wildcards during searches.
Many databases and spreadsheet programs treat characters like asterisks (*) or question marks (?) as wildcard commands. To search for these literal characters, you must instruct the program to ignore their wildcard properties.
Open your table design view or spreadsheet properties and ensure the data type for the part number field is explicitly set to 'Short Text' or 'Text'.
When searching for characters that typically act as wildcards within database applications like Access, enclose them in square brackets. For example, to search for an asterisk, type [*].
To find spaces or other standard symbols like hyphens and ampersands, simply include them in your query criteria enclosed in quotation marks, such as "* *" to find values containing a space, or "*&*" for an ampersand.

Create a Complex Validation Query
Design a specific query that checks for allowed characters and filters out values containing unexpected symbols or spaces.
Easily Search and Manage Part Numbers in WPS Spreadsheet
Avoid complex database queries by managing your part numbers in WPS Spreadsheet. WPS Office offers robust data formatting and search tools to handle special characters, spaces, and formatting without triggering formula or date conversion errors.
- 1. Format Column as Text: Select your part numbers column, right-click, choose 'Format Cells', and set the category to 'Text'.
- 2. Open Find and Replace: Press Ctrl + F to open the Find dialog box in WPS Spreadsheet.
- 3. Search for Literal Special Characters: Type the specific character, space, or symbol you are looking for. To find literal wildcards like '*' or '?', prefix them with a tilde (~).
- 4. Review Results: Click 'Find All' to display a complete list of all part numbers containing the specified special characters.

Frequently Asked Questions
Why does my database convert part numbers with hyphens into dates?
This happens when the data field is set to a 'General' or 'Number' format instead of 'Text'. The system misinterprets hyphens or slashes as date separators. Always format part number columns as Text before entering data.
How do I search for an actual asterisk (*) without returning all records?
In database queries, enclose the asterisk in square brackets [*]. In spreadsheet applications like WPS Spreadsheet or Excel, place a tilde (~) before the asterisk, like ~*, to indicate you are searching for the literal character rather than a wildcard.
Can I easily find trailing or leading spaces in my part numbers?
Yes. You can use search functions to look for spaces, or utilize the TRIM function in a neighboring column to automatically identify and remove unwanted leading and trailing spaces from your data entries.




