Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have the following table ,
(Q : Department_Id have values & no Sales.....what will happen ? )
Service_Order:
Load
field1,field2,field3,................,Sales,Date,Service_Center,Department_Id
From location;
Inner Join
Load
Date,Service_Center,Department_Id,
sum(sales) as Total_Sales,
sum(if(Date>=AddMonths(today(),-12),Sales)) as Last_12_Months_Sales
resident Service_Order
group by
Date,
Service_Center,
Department_Id;
.... well, do you mean that you have no records for the department without sales, or that the sales value are null? If they are null, then Sum(sales) will return 0 - but if you had tested that yourself, you would already know that.