Here are a couple of options:
<pre>UPDATE yourTable
SET yourField = STRING(9-LEN(yourField),'0') & yourField
WHERE LEN(yourField) < 9;</pre>
<pre>UPDATE yourTable
SET yourField = RIGHT(STRING(9, '0') & yourField, 9)
WHERE LEN(yourField) < 9;</pre>
You could create a function to parameterize the padding:
<pre>Public Function lPad(strIn, n As Integer, strPad As String) As String
lPad = STRING(n-LEN(strIn),strPad) & strIn
End Function</pre>
or
<pre>Public Function lPad(strIn, n As Integer, strPad As String) As String
lPad = RIGHT(STRING(n, strPad) & strIn, n)
End Function</pre>
And then use this function in your queries:
<pre>UPDATE yourTable
SET yourField = lPad(yourField,9,'0')
WHERE LEN(yourField) < 9;</pre>