Hey All!
I was wondering what the best way to acheive this result would be. I have a 'Description' field within my database table that I would like to shorten on one of the pages, like so:
This is a really really long description
would become:
This is a really rea...
I have tried using the following SQL queries:
SELECT ID, Name, LEFT(Description, 40) + '...' AS 'ShortDesc'
FROM tbl
SELECT ID, Name, SUBSTRING(Description, 1, 40) + '...' AS Description
FROM tbl
None of these give me the desired results. Is there a way that I can manipulate this data through the code rather than within the SQL query? or am I just getting the SQL syntax wrong? I am coding in C#
Thanks
I was wondering what the best way to acheive this result would be. I have a 'Description' field within my database table that I would like to shorten on one of the pages, like so:
This is a really really long description
would become:
This is a really rea...
I have tried using the following SQL queries:
SELECT ID, Name, LEFT(Description, 40) + '...' AS 'ShortDesc'
FROM tbl
SELECT ID, Name, SUBSTRING(Description, 1, 40) + '...' AS Description
FROM tbl
None of these give me the desired results. Is there a way that I can manipulate this data through the code rather than within the SQL query? or am I just getting the SQL syntax wrong? I am coding in C#
Thanks