All Forums Database
u156531 6 posts Joined 10/14
22 Oct 2014
Padding a field in a select statement with spaces

Hi, I have a column in a select statement that needs to always result in 19 characters including spaces. It will always be populated with a different number of characters so I need to know how to pad the end with spaces after the last character. Can someone give me the syntax for this.

dnoeth 4628 posts Joined 11/04
22 Oct 2014

Adding trailing spaces?
CAST('bla' AS CHAR(19))


You must sign in to leave a comment.