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

Sometimes it will, sometimes it won't....

Status
Not open for further replies.

dzdncnfsd

MIS
Jul 14, 2000
118
US
In Query Analyzer, I typed in the following:
"Select space(13)+[cus-loan] as account from Minimaster"
It returned a list of loan numbers all starting with 13 spaces. Next I typed in:
"Select space(13)+[cus-loan] as account, [cus-name] from Minimaster"
This time I got the following error:
"Invalid operator for data type. Operator equals Boolean AND, type equals nvarchar."

Cus-loan is a varchar data-type in the table. Why does this work if it is the only field I ask for but not when I ask for additional fields as well?

Also, is there a one command approach to trim a string, or do you have to do LTRIM(RTRIM(field)) every time?
Thanks,
Gladys

Gladys Clemmer
gladys.clemmer@fifsg.com

 
is easy to separate with () as below:
Select (space(13)+[cus-loan]) as account, [cus-name] from Minimaster John Fill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top