When comparing a string against another string with the @ wildcard in the middle, there can be different outcomes depending on a particular setting.
When navigating from the top toolbar to Design > Database Settings > Database, the setting "Consider @ as a wildcard only when at the beginning or end of text patterns" when enabled can cause errors if the wild card is used in the middle of a string.
Take the example below where a string is tested against another string with the wildcard in the middle.
If the setting "Consider @ as a wildcard only when at the beginning or end of text patterns" is checked and the code is executed, the @ wildcard in the middle of the string will be completely ignored and the comparison will return false.
However, unchecking the setting mentioned above will allow wildcards in the middle of the string, and the string comparison will be valid.
In conclusion, always be sure that the setting above is unchecked when deciding to use @ wildcards in the middle of a string.