I have a report that gives total pounds produced in a day. My question is if there is a way to add a condition to my report so that if totallbs = 0 the report will not generate? This is ASP code and it is a report file being written to the page as HTML.
Below is the SQL Query used in the report
Below is the SQL Query used in the report
Code:
SQLQuery = "SELECT ISNULL(SUM(LaborVariance),0) LaborVariance, ISNULL(SUM(MaterialVariance),0) MaterialVariance, ISNULL(SUM(LBSProduced),0) LBSProduced, CASE WHEN ISNULL(SUM(ConsumedQTY),0) = 0 THEN 0 ELSE ISNULL(SUM(LBSProduced),0)/SUM(ConsumedQTY)*100 END Yield, COUNT(DISTINCT Item) ItemsProduced, COUNT(MO) JobsClosed FROM ReportsMOVariance (NOLOCK) WHERE CloseDate = '" & ReportDate & "'"
rs.Open SQLQuery, MyConn
p=rs.GetRows()
rs.close