Good Afternoon
I need a column to show in a report as 10 digits long by adding zero's to the left of the result. My select statement is like this:
SELECT
a.client,
a.apar_id
FROM agltransact a
where a.client = 'SD'
and a.account NOT IN ('9600','9621')
and a.dim_2 <> ''
and a.voucher_type = 'AP'
my result is:
client apar_id
SD 2097
SD 2013
SD 20026
SD 2531
SD 2472
SD 2085
What I need is the apar_id column to be 10 digits long, preceeded with leading zero's. The results could have as little as 3, or as many as 7 digits.Can anyone help me out with the sql to show this? I am using ms sql server. The column I believe is a varchar.
Many Thanks
Lorna
I need a column to show in a report as 10 digits long by adding zero's to the left of the result. My select statement is like this:
SELECT
a.client,
a.apar_id
FROM agltransact a
where a.client = 'SD'
and a.account NOT IN ('9600','9621')
and a.dim_2 <> ''
and a.voucher_type = 'AP'
my result is:
client apar_id
SD 2097
SD 2013
SD 20026
SD 2531
SD 2472
SD 2085
What I need is the apar_id column to be 10 digits long, preceeded with leading zero's. The results could have as little as 3, or as many as 7 digits.Can anyone help me out with the sql to show this? I am using ms sql server. The column I believe is a varchar.
Many Thanks
Lorna
Comment