Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pad field with spaces 1

Status
Not open for further replies.

lisaharris

Programmer
Feb 12, 2007
130
US
I know the "trim" function can strip trailing spaces from a field, but what about when I need the reverse to happen?

I have a field that is 17 characters long by definition. Length of user input varies, but I need to extract the data for another program and it has to have all 17 characters filled in (i.e. trailing spaces after the data to fill to 17). So if the data input is 7 characters, I'd need 10 spaces at the end. This has to be padded in an update or make-table query and can't be done at the time of data entry because the field is used elsewhere and can only have the trailing spaces for one extract.

It's too late on a Friday and my brain is turning to mush. There's probably something simple that I've overlooked. Thanks for any insight.
 
Left(yourField & Space(17), 17)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Worked like a charm!! Thanks!!

__________
It's better to have loved and lost than live with the idiot for the rest of your life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top