How to generate zero for data when getting datas from sql? #9975
Unanswered
unluckychild
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Im having problem, when i get data for my graph, but one month is missing, no sales there. Normally it would be zero, but im generating data from sql and it completely skip this and shows only valid results like
8/21, 9/21, 11/21
ps: this is my query
select sum(export_products.quantity * export_products.per_price) as totalpm, DATE_FORMAT(date,'%m/%Y') AS datum
from export left join export_products on export.id=export_products.export_id left join
products on products.id=export_products.product_id where products.category=$id
group by month(date)
PS: solved with PHP
Beta Was this translation helpful? Give feedback.
All reactions