Home Forums SQL Server 7,2000 General How to right-align a text column - SQL Srv 2000 RE: How to right-align a text column - SQL Srv 2000

  • You could try to add spaces as a prefix, and then take the rightmost n characters, e.g.:

    selectright(space(10) + rtrim('hi'), 10)

    union all

    selectright(space(10) + rtrim('hello'), 10)

    The result is:

    ----------

    hi

    hello

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software