Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. ERROR: operator does not exist : time without time zone >= bytea
  2. Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
  3.  
  4. select sto.name AS store,
  5. sum(odi.subtotal_price) AS sales, sum(odi.qty) AS qty_sold,
  6. ((sum(odi.subtotal_price))/(sum(odi.qty))) AS average,
  7. min(CAST(ord.date_out AS date)) AS start_date,
  8. max(CAST(ord.date_out AS date)) AS end_date,
  9. concat(min(CAST(ord.date_out AS time)), ' - ', max(CAST(ord.date_out AS time))) as time,
  10. sum(odi.cost_of_good_sold*odi.qty) AS COGS, ((sum(odi.cost_of_good_sold*odi.qty))/(sum(odi.qty))) AS average_cogs,
  11. date_trunc('day', ord.date_out) AS trx_day
  12. FROM trx_order_detail_item odi
  13. LEFT JOIN trx_order AS ord on ord.id = odi.order_id
  14. LEFT JOIN mst_store AS sto on sto.id = ord.store_id
  15. WHERE sto.id = :store and ord.date_out between :date1 and :date2
  16. and CAST(ord.date_out AS TIME) BETWEEN :hour1 AND :hour2 and ord.order_status_id IN :orderstatus and ord.void_status = :voidStatus
  17. GROUP BY sto.name, date_trunc('day', ord.date_out)
  18. ORDER BY date_trunc('day', ord.date_out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement