Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PADR
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Re: PADR
Miscellaneous
Thread ID:
01406912
Message ID:
01406925
Views:
42
>I'm trying to pull two columns with some space between:
>
>
>
>	SELECT	PartId, 
>			PartInfo = PartNo + RIGHT(REPLICATE(' ', 20) + Description
>		FROM Parts
>		ORDER BY PartInfo
>
>
>I'm getting 'Incorrect syntax near the keyword 'FROM'.'
>
>I got this example from http://www.sqlusa.com/bestpractices2005/padleadingzeros/

In your case as Sergey pointed out you simply need to cast PartNo to the CHAR of the appropriate length.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform