Neal Wilson 9 anos atrás
pai
commit
b9a6310bfd
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1
    1
      config/Windows/history.xml

+ 1
- 1
config/Windows/history.xml Ver arquivo

@@ -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
 			}

Carregando…
Cancelar
Salvar