Link to home
Start Free TrialLog in
Avatar of GlobaLevel
GlobaLevelFlag for United States of America

asked on

ms sql server - manage appearance of the query...

Im trying to create a simple autocomple on my asp.net/vb.net web form..I hear usercontrols are nicer..but im going the cheap route with this..this query will then pull into a dropdown box on my web form.  the query works, however I am wantingthe columns to line up and right now they dont. Any suggestions?

so for example there are 4 columns and they look like this:
[dddd ] [rrrr][ ] [hhhhhhhhh]
[hh][ssssssssss][aaa][eeeeeeeeee]

when it needs to look like this:
[dddd ] [rrrr          ][     ][hhhhhhhhh]
[hh    ] [ssssssssss ][aaa][eeeeeeeeee]


the columns should line up...

below is the query, if you run it with your own data you will see what I am saying...
SELECT '[' + LEFT(cast(name as nvarchar(max)),30) + '] [' + LEFT(cast(city as nvarchar(max)),20) + '] [' + LEFT(cast(shoeid as nvarchar(max)),20) + '] [' + LEFT(cast(shoetype as nvarchar(max)),20) + ']' 
                         FROM  shoe descrpt 
                         WHERE name like '%q%'
                         and  Type <> 'shoe' 
                         ORDER BY Name ASC

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Eric3141
Eric3141
Flag of Afghanistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial