Hi,
I would like to make my query such that it will always return all result, with the result that did not match the criteria to be set to zero. How do I do that??
Below is an example:
I have the following table:
ProdtID|ProdtType|Cost|MauType|DatePurc
P001|Stationary|2000|15/1/2010
P002|Music|3000|18/1/2010
P003|Book|4000|11/7/2010
P004|Electronics|5000|5/10/2010
Whenever I run my query to retrieve the result based on a DatePurc(Date of Purchase), the results that returned does not conform to a fixed format.
Eg: If I select all ProdtType and Cost that is between 1/1/2010 to 18/4/2010, results returned only Stationary and Music with 2000, 3000 as cost.
That is correct. However, I would like to fix the query such that it also returned Book and Electronics with their price set to 0, since they did not match the criteria.
Desired Output when I run my query:
Stationary|2000
Music|3000
Book|0
Electronics|0
Reason for doing that: I would like to display the results in a table format for analysis. Therefore, I would still need the results even though it didnt meet the criteria.
Any ideas how to achieve the desired effect??
Many thanks ahead!
I would like to make my query such that it will always return all result, with the result that did not match the criteria to be set to zero. How do I do that??
Below is an example:
I have the following table:
ProdtID|ProdtType|Cost|MauType|DatePurc
P001|Stationary|2000|15/1/2010
P002|Music|3000|18/1/2010
P003|Book|4000|11/7/2010
P004|Electronics|5000|5/10/2010
Whenever I run my query to retrieve the result based on a DatePurc(Date of Purchase), the results that returned does not conform to a fixed format.
Eg: If I select all ProdtType and Cost that is between 1/1/2010 to 18/4/2010, results returned only Stationary and Music with 2000, 3000 as cost.
That is correct. However, I would like to fix the query such that it also returned Book and Electronics with their price set to 0, since they did not match the criteria.
Desired Output when I run my query:
Stationary|2000
Music|3000
Book|0
Electronics|0
Reason for doing that: I would like to display the results in a table format for analysis. Therefore, I would still need the results even though it didnt meet the criteria.
Any ideas how to achieve the desired effect??
Many thanks ahead!