Suppose I have a table called “products”:
Productive product-name product-quantity created-date 111 ABC 10 1/10/2018 222 XYZ 20 1/10/2018 333 PQR 30 1/11/2018 444 MNC 40 1/15/2018 555 DEF 50 1/11/2018
If I run this query:
Select convert(date,createddate,101), count(product-quantity) from products Where created-date > 1/9/2018 and created-date < 1/16/1018 group by convert(date,createddate,101)
Which will give me output such as
created-date. product-quantity 1/10/2018 30 1/11/2018 80 1/15/2018 40
I want to achieve:
created-date. product-quantity 1/10/2018 30 1/11/2018 80 1/12/2018 00 1/13/2018 00 1/14/2018 00 1/15/2018 40
How can I do it?