Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
I have a table with the fields CodCliente, CodProd and Fecha.
I want to subtract the last value to the penultimate Fecha group by CodCliente and CodProd and next make the average of the substract.
This is the table:
CodCliente | CodProd | Fecha |
1 | 1 | 30/04/2012 |
1 | 1 | 07/05/2012 |
1 | 1 | 15/05/2012 |
1 | 2 | 26/05/2012 |
1 | 2 | 18/06/2012 |
2 | 1 | 02/07/2012 |
2 | 1 | 25/08/2012 |
2 | 1 | 09/10/2012 |
2 | 2 | 15/10/2012 |
2 | 2 | 23/10/2012 |
2 | 2 | 02/11/2012 |
2 | 2 | 14/11/2012 |
I need substract for the CodCliente 1 and CodProd 1 15/05/2012 - 07/05/2012 and next substract for the CodCliente 1 and CodProd 2 18/06/2012 - 26/05/2012 and calculate de average of this.
Regards
See attached example.
Thanks,Gysbert, the example is exactly that i needed.
Regards