How to Change Color of the data???
-
hi , I am sending a mail using SQL server 2005 msdb.dbo.sp_send_dbmail , below written is my code:- I need to change the color of the data . depending upon the value , i want to change it's color. Kindly help me out. DECLARE @tableHTML NVARCHAR(MAX) ; SET @tableHTML = N'<H1>Cummalative Airtel Report generated every half hour</H1>' + N'<table width="100%" style="font-family:Arial; font-size:12px; color:#000066" border="1" cellspacing="0" cellpadding="0">' + N'<tr><td width="20%"><b>Circle</b></td><td width="11%"><b>OfferedCalls</b></td>' + N'<td width="11%"><b>AnsweredCalls</b></td><td width="11%"><b>AbandonedCalls</b></td>' + N'<td width="11%"><b>PCA</b></td><td width="11%"><b>ATT</b></td>' + N'<td width="11%"><b>FCR</b></td>' + N'<td width="11%"><b>CQ</b></td>' + N'</tr>' + CAST ( (Select td =t.circle, '' ,td = t.offd, '' ,td =t.answ, '' ,td =t.abnd, '' , --td =Convert(char,Round(t.[%abnd],2)), -- '' , td =Convert(char,Round(t.pca,2)), '' , td =Convert(char,round(tt.SumAtt/Answ,2)), '' ,--td =ttt.[login], '' , td =Convert(char,Round(ttttt.[CQScore],2)),'', td=Convert(char,Round(fcr.[fcr],2)) from FOR XML PATH('tr'), TYPE ) AS NVARCHAR(MAX) ) + N'</table>' ; EXEC msdb.dbo.sp_send_dbmail @profile_name='MailProfile', @recipients='abc@gmail.com', @subject = 'TestReport', @body = @tableHTML, @body_format = 'HTML' ; Regards, Aman