VBA allows for user-defined string formats in Format()
. I am particularly interested in replicating the placeholder characters, @
and !
in SQL Server (using its Format()
function? - open to alternatives).
My use case requires a mix of characters and numbers stored as a Variant
type in VBA.
With @
and !
placeholder characters, here is what I would like to mimic from VBA in SQL Server.
VBA:
Format(12DFR89, "!@@-@-@@@@")
- Output: 12-D-FR89