I am writing an export for a customer and they are requesting that all fields have leading 0's up to 10 digits. I have done that on all fields except for two fields. I am using this query:
SELECT RIGHT('0000000000'+ISNULL(RTRIM(a.tqtyshp),''),10)as tqtyshp, RIGHT('0000000000'+ISNULL(RTRIM(a.price),''),11) AS price,
FROM artran a
LEFT JOIN arcust b ON a.custno = b.custno
WHERE invdte BETWEEN DATEADD("d",-7,GETDATE()) and GETDATE()+5 AND code = '127'
And I get the following results:
003.000000 00034.64000
003.000000 00029.96000
003.000000 00032.65000
003.000000 00031.58000
003.000000 00022.18000
I need the results to look like this:
00000003.00 00000034.64
00000003.00 00000029.96
00000003.00 00000032.65
00000003.00 00000031.58
00000003.00 00000022.18
The fields in question are formatted as decimal(15,6)
This is similar to the question I asked yesterday but in this question I am trying to format the decimal places. The other question I was just trying to get the total character count to 10.