Query sum is not getting zero, if there is not specific record. I want to have zero value (Price).
if there is record then meaning record is not empty, then query works perfectly fine.
I have attached
1)query picture
2) Sql code
as shown in picture, query is trying to fetch record with "Pending" field. when there are such records with "Pending" then it works pretty well. when there not such record (row) in table, query sum of "Pending" as well as Sum of Price should be zero.
Can someone help.
Thank you
if there is record then meaning record is not empty, then query works perfectly fine.
I have attached
1)query picture
2) Sql code
Code:
SELECT Sum(StatusQuery.[Date(User)]) AS [SumOfDate(User)], MainOrdersEntries.Status, Sum(MainOrdersEntries.TotalPrice) AS SumOfTotalPrice
FROM StatusQuery INNER JOIN MainOrdersEntries ON StatusQuery.ID = MainOrdersEntries.ID
GROUP BY MainOrdersEntries.Status
HAVING (((Sum(StatusQuery.[Date(User)]))>=Date()-60) AND ((MainOrdersEntries.Status)="Pending"));
Can someone help.
Thank you