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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Left align 2

Status
Not open for further replies.

mcginty

IS-IT--Management
Mar 14, 2001
35
0
0
IE
Hi all,

I have text in a 20char text field which I want to left align and pad out any remaining spaces with spaces in a query

I can left align the data (Format([field1],!)and I can pad out the spaces (Format([field1],"@@@@.."), but I can't seem to do both.

Any suggestions would be welcome.
Ted
 
mcginty,

mpastore is correct in his solution. You can also use:

mystr: Left(Trim([sStr]) & Space(20),20)

This will give the same results but is slightly faster because it reduces the number of computations that are needed. In a long query, it could make a difference.


[shadeshappy] Cruising the Information Superhighway
[sub] (your mileage may vary)[/sub]
 
Great, Guys,

Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top