Please help me with the union query,,
It consist of 2 queries and 1 table. (Petshop orders,clinic orders and orders).
This query calculate the total sales, (petshop orders.total+clinic orders.totalcharges), this works fine. But if one of the field dont have value then no value will display. I use already the Nz function.
Here is my code in my union query:
SELECT [OrderID],[OrderDate],Nz([Order Details Petshop Query].Total,0) AS Petshop,Nz([Order Details Query Query].TotalCharges,0) AS Klinik,(Nz([Total],0) + Nz([TotalCharges],0)) AS Sales FROM [Orders]
UNION SELECT [OrderID],[OrderDate],Nz([Total],0) AS [Petshop],NULL,NULL FROM [Order Details Petshop Query]
UNION SELECT [OrderID],[OrderDate],NULL,Nz([TotalCharges],0) AS [Klinik],NULL FROM [Order Details Query Query];
Hope anyone can help me with this,,,Thanks...
It consist of 2 queries and 1 table. (Petshop orders,clinic orders and orders).
This query calculate the total sales, (petshop orders.total+clinic orders.totalcharges), this works fine. But if one of the field dont have value then no value will display. I use already the Nz function.
Here is my code in my union query:
SELECT [OrderID],[OrderDate],Nz([Order Details Petshop Query].Total,0) AS Petshop,Nz([Order Details Query Query].TotalCharges,0) AS Klinik,(Nz([Total],0) + Nz([TotalCharges],0)) AS Sales FROM [Orders]
UNION SELECT [OrderID],[OrderDate],Nz([Total],0) AS [Petshop],NULL,NULL FROM [Order Details Petshop Query]
UNION SELECT [OrderID],[OrderDate],NULL,Nz([TotalCharges],0) AS [Klinik],NULL FROM [Order Details Query Query];
Hope anyone can help me with this,,,Thanks...