>Your example with ALLTRIM() and several parameters works in VFP but it is not compatible with SQL Sever (as far as I know). But at least I know what causes the problem
I don't think you'll find anything compatible with all SQL implementations (VFP, MSSQL 20xx, MySQL, etc.). I believe MSSQL Server 2017 introduced the capability of trimming arbitrary characters (and not only spaces), but can't tell for sure as I don't have access to any 2017 instance.
----------------------------------
António Tavares Lopes