Re: Prod_Id wise max date from the selected date range and the sales for that date.
One question, why do you have to date fields? One would be enough. Then based on the selection you could better provide the data. Because in this case, you only have to consider the To_Date, ignore the From_Date within the set analysis.