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

white spaces

Status
Not open for further replies.

Norman55

Programmer
Apr 27, 2006
48
GB
im hoping someone can help....
instead of trying to get rid of whitespace i need to created them so when i return the results in a Qry if there are only 2 charactors it will force 2 white spaces at the end ?
 
Code:
SELECT CONVERT(CHAR(4), YourColumn)
FROM YourTable

The CHAR datatype is fixed width. So if you convert your column to CHAR(4) in your query, all values for that column in the resultset will have a length of 4.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top