Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am struggling with the following problem..
I've got a table containing repairs.. Every records contains a unique repairordernumber, a serialnumber and a orderdate. I would like to calculate the number of days between repairs of each serialnumber. Can someone tell me how to script this?
Thanks, Sander
Something like:
RIGHT JOIN LOAD DISTINCT *,
if(peek('repairordernumber') = repairordernumber, orderdate - peek('orderdate'), 0) as daysBetween
RESIDENT repairs
ORDER BY repairordernumber, orderdate;
-Rob