Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How to Change Color of the data???

How to Change Color of the data???

Scheduled Pinned Locked Moved Database
htmlsharepointdatabasesql-servercom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aman786Singh
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups