<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> </div>
<div>Hopefully someone can put me out of my misery</div>
<div> </div>
<div>in the following item number can be 1 to 99 always 2 digits</div>
<div> </div>
<div>I want to end up with a 6 digit order number and a 2 digit , with a leading zero if necessary item number in sales_oi_number</div>
<div> </div>
<div><span style="background-color:#e6e6fa;">select </span></div>
<div> </div>
<div><span style="background-color:#e6e6fa;">sales_oi_number = </span><span style="background-color:#e6e6fa;">varchar</span><span style="background-color:#e6e6fa;">(order_number) + </span><span style="background-color:#e6e6fa;">varchar</span><span style="background-color:#e6e6fa;">(item_number)</span></div>
<div> </div>
<div><span style="background-color:#e6e6fa;">from </span><span style="background-color:#e6e6fa;">xxxxx</span></div>
<div> </div>
<div>order_number and item_number are integers </div>
<div> </div>
<div>for order_number 123456 and item_number 22 sales_oi_number would be '12345622'</div>
<div> </div>
<div>for order_number 123456 and item_number 2 how do I get '12345602' and not '1234562'</div>
<div> </div>
<div>Is there a slick of doing this - I can imagine a tortuous route of left() right() etc etc</div>
<div> </div>
<div>thanks</div>
<div>Allan </div>
<div> </div>
<div> </div></div></body></html>