html颜色随着价值的变化而变化

时间:2018-04-18 00:21:40

标签: html sql colors

我正在使用Sql管理器运行查询并将它们放入HTML中以便我可以发送电子邮件,有没有办法在特定值更改时更改输出的颜色,在我的示例中我希望每次更改leadtech时都会更改颜色更改(员工),以便在查看日期时更容易识别更改

SET @xml2 = CAST(( SELECT leadtech as 'td', '', ITEM.CC_TYPE as 'td','', ordDET.ITEM_NO AS 'td','', ITEM.[DESC]AS 'td','', SUM(ordDET.QTY_ORD) AS 'td','', SUM(ordDET.EXTENDED) AS 'td'
FROM PL00.DBO.ordhdr INNER JOIN PL00.DBO.orddet ON ordhdr.ORDER_NO = orddet.ORDER_NO
                     INNER JOIN PLSHARED.DBO.item ON ITEM.ITEM_NO = orddet.ITEM_NO
                     inner join PL00.dbo.employee on employee.EMP_ID = ordhdr.LEADTECH
                     inner join pl00.dbo.grpmemb on grpmemb.EMP_ID = employee.EMP_ID
and ordhdr.DT_COMPLT = CONVERT(varchar(10), getdate(), 121)
AND orddet.EXTENDED <> 0
and grpmemb.GROUP_ID like 'Steve%'
GROUP BY leadtech, ITEM.CC_TYPE, orddet.ITEM_NO,  ITEM.[DESC]
ORDER BY leadtech, ITEM.CC_TYPE, SUM(ordDET.QTY_ORD) DESC, SUM(ordDET.EXTENDED) 
FOR XML PATH('tr'), ELEMENTS ) AS NVARCHAR(MAX))


SET @body2 ='<html><body><H3>Daily Parts Sold Detailed</H3>
<table border = 1> 
<tr>
<th> Tech </th> <th> Type </th> <th> ItemNO </th> <th> ItemDesc </th> <th> QtySold </th> <th> TotalSales </th> </ </tr>

&#39;

0 个答案:

没有答案