bemara57
asked on
How do I pad spaces to a SELECT field in MS Access?
How do I pad left to a field I select so it is always 10 characters long (padded with spaces. So this:
2834
02149803
203985
234
Would become this in my SELECT statment:
2834 (padded 6 spaces to the left of the number)
02149803 (padded 2 spaces to the left of the number)
203985 (padded 4 spaces to the left of the number)
234 (padded 7 spaces to the left of the number)
I'm looking for something in MS Access where I can do something like SELECT PAD(nbr," ") FROM table. Anything like this exist?
2834
02149803
203985
234
Would become this in my SELECT statment:
2834 (padded 6 spaces to the left of the number)
02149803 (padded 2 spaces to the left of the number)
203985 (padded 4 spaces to the left of the number)
234 (padded 7 spaces to the left of the number)
I'm looking for something in MS Access where I can do something like SELECT PAD(nbr," ") FROM table. Anything like this exist?
SELECT Right(" " & nbr, 10) AS PaddedNbr
FROM SomeTable
FROM SomeTable
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT Format([YourNumber],"00000 00000") AS NewNbr FROM [YourTable];
mx