Reputation: 85
I have a quantity that I want displayed as a whole number so I am using the below statement.
concat(CAST(oe_pick_ticket_detail.unit_quantity AS DECIMAL(10,0))
Right now it is returning 400
I'd like it to be an 8 digit number like this 00000400
How should I modify this?
Upvotes: 0
Views: 154
Reputation: 81970
If SQL Server 2012+
Select Format(oe_pick_ticket_detail.unit_quantity,'00000000') -- Returns 00000400
Another non-format option
Select right(concat('00000000',oe_pick_ticket_detail.unit_quantity),8) -- Returns 00000400
Upvotes: 2