Hi All,
I am generating a Report through SQL that emails a set of data results in a HTML table to Fee Earners in our firm. I would like to know, how I can set the font to red when the "Total" is greater than $10,000. The SQL code I have for the Email body is as follows:
SET @tableHTML =
N'<h2 style=''font-family:arial;color:#048a55;''>Fees and Disbursements Report</h2>' +
N'<p style=''font-family:arial;color:#555555;''>This is an automated email. Please review your Fees and Disbursements Report.<br/><br/>Thank you.<br/>Account Team</p>' +
N'<table style=''text-align:center;font-family:arial;color:#555555;font-size:15px'' border="1">' +
N'<tr><th style="background-color: #05fcb6;">Client Code</th><th style="background-color: #05fcb6;">Client Name</th><th style="background-color: #05fcb6;">Matter Code</th>
<th style="background-color: #05fcb6;">Matter Description</th><th style="background-color: #05e7fc;">Total Fees</th>
<th style="background-color: #05e7fc;">Total Disbursements</th><th style="background-color: #05e7fc;">Total</th></tr>' +
CAST ( ( SELECT
td = CLIENT_CODE, '',
'left' AS 'td/@align',
td = CLIENT_NAME, '',
td = MATTER_CODE, '',
'left' AS 'td/@align',
td = LONG_MATT_NAME, '',
'right' AS 'td/@align',
td = '$' + FORMAT(TOTAL_FEES, 'N2'), '',
'right' AS 'td/@align',
td = '$' + FORMAT(TOTAL_DISB, 'N2'), '',
'right' AS 'td/@align',
td = '$' + FORMAT(TOTAL, 'N2'), ''
FROM #WIP_DISB_EMAIL
WHERE EMAIL = @tiedtlaw email
ORDER BY CLIENT_CODE, TOTAL_FEES DESC
FOR XML PATH('tr'), TYPE) AS NVARCHAR(MAX) ) +
N'</table>' +
N'</br></br>' +
+
Any help would be greatly appreciated.
Regards
Tony