Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have data in a SQL table that is displaying like this:

C#
BIO12345-A   -Wifey   
BIO12345-B   -Life and Times of Collins     
BIO12346     -Madeline
BIO12347     -Cooking with Betty
BIO99999-A-San Francisco Superstars
BIO99999-B-San Diego Superstars
BIO12348    -The Life of PI


The above is the result of concatenating the First field with the second, title field like this:
JavaScript
SELECT Title, FileID, FileID + ' - ' + Title  AS TitleIndo   
FROM Library_Info



The data is uploaded from an Excel spreadsheet and I am outputting these results in a query and in a dropdown box.

How do I get the 5th and 6th records to display with the same alignment as the other records? This is affecting how the labels we insert on the book covers print.

What I have tried:

RTrim, Ltrim, I checked the data for hidden carriage returns (there weren't any),
JavaScript
like '%'+char(13)+'%'

and
JavaScript
like '%'+char(10)+'%'
, google search
Posted
Comments
Wendelius 24-Oct-16 17:14pm    
The example data doesn't look like it's directly from the SQL statement since it's already formatted differently. But more importantly, what client technology you use, Forms, WPF, ASP?

1 solution

Have you tried using this?
SQL
SELECT Title, 
FileID, 
LEFT(LTRIM(FileID)+SPACE(13),13) + ' - ' + Title  AS TitleIndo   
FROM Library_Info
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900