April 18th, 2012, 06:29 PM
Unable to add CR (Carriage Return) between data in table cell
I have a table which is dynamically created and works perfectly. In one of the cells I am selecting a range of data (multiple rows) from another table and placing them all in one cell on the table.
My data currently looks like this:
April 01 2012 | A | Adam // April 02 2012 | B | Bruce // April 03 2010 | C | Casper
I need to place a CR (Carriage Return) in place of the // so as my data looks like this:
April 01 2012 | A | Adam
April 02 2012 | B | Bruce
April 03 2010 | C | Casper
My code is held in an SQL View & is as follows:
ALTER VIEW [dbo].[table_information]
(SELECT (' // ' + CAST(RHR.ReviewedDate AS VARCHAR(11)) + ' | ' + (RHR.ReviewedRisk_ID) + ' | ' + RTRIM(RHR.ReviewedRiskComment) + char(10) + char(13))
FROM RISK_HISTORY RHR
WHERE EDIT_HISTORY.EditHistory_ID = RHR.EditHistory_ID
ORDER BY RHR.EditHistory_ID, RHR.ReviewedDate, RHR.ReviewedRisk_ID, RHR.ReviewedRiskComment for xml path('')) AS Reviews
My apologies if i have placed this request for help in the wrong place. I could not find anywhere that really suited it.
April 19th, 2012, 02:44 AM
Re: Unable to add CR (Carriage Return) between data in table cell
In HTML you would use a line break or <BR> ...
try placing that instead of a CR...
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!