RichardParry
IS-IT--Management
Hi All,
I think this should be my last query in relation to a recent export I am trying to do from a DB in T-SQL. What I need to do is within my SELECT output is specify the character length of some columns. For example, although the data in the column may only be 4 characters I need to output the 4 characters of data, plus add spaces on the end, to equal a set number of characters, e.g. 8. So for example, my normal output that would be "TEXT", which is 4 chars would need look like "TEXT " as 8 characters, with spaces on to fill the blanks - if that makes sense. Never tried this before so could do with a bit of help please
There are about 9 columns of data I need to format like this, some using a variable set to a number of characters earlier on in the view, and some are simply hard-coded.
Thanx again!!!
I think this should be my last query in relation to a recent export I am trying to do from a DB in T-SQL. What I need to do is within my SELECT output is specify the character length of some columns. For example, although the data in the column may only be 4 characters I need to output the 4 characters of data, plus add spaces on the end, to equal a set number of characters, e.g. 8. So for example, my normal output that would be "TEXT", which is 4 chars would need look like "TEXT " as 8 characters, with spaces on to fill the blanks - if that makes sense. Never tried this before so could do with a bit of help please
There are about 9 columns of data I need to format like this, some using a variable set to a number of characters earlier on in the view, and some are simply hard-coded.
Thanx again!!!