Neal Wilson пре 9 година
родитељ
комит
b9a6310bfd
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1
    1
      config/Windows/history.xml

+ 1
- 1
config/Windows/history.xml Прегледај датотеку

@@ -31,7 +31,7 @@
31 31
 				var dateRange = dateSelect.currentRange();
32 32
 				var startDate = "'"+dateRange[0]+"'";
33 33
 				var endDate = "'"+dateRange[dateRange.length - 1]+"'";
34
-				var q = "SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) AS weight_loss, duration, annotation FROM roasting_log WHERE time >= " + startDate + "::date AND time < " + endDate + "::date + interval '1 day' ORDER BY time DESC";
34
+				var q = "SELECT time, machine, (SELECT name FROM items WHERE id = roasted_id) AS name, unroasted_total_quantity AS green, roasted_quantity AS roasted, CASE WHEN unroasted_total_quantity = 0 THEN NULL ELSE ((unroasted_total_quantity - roasted_quantity) / unroasted_total_quantity * 100::numeric)::numeric(12,2) END AS weight_loss, duration, annotation FROM roasting_log WHERE time >= " + startDate + "::date AND time < " + endDate + "::date + interval '1 day' ORDER BY time DESC";
35 35
 				table.setQuery(q);
36 36
 				table.hideColumn(1);
37 37
 			}

Loading…
Откажи
Сачувај