Hello Time-Experts
my problem is as follows:
I have one table with invoices I payed. They are for services in e certain time-period, let's say from February till October, on one invoice-record,
In the second table there are my Customers. They worked with me for other time-periods, let's say, one from January till March, one from March till September and one from September till December.
Now how can I calculate the intersection-times?
I'd like to see my original invoice with a portal where I have listed all those customers which will pay a part of the invoice.
Something like this:
------
Invoice A | Service from 02/01/11 till 10/31/11 | (273 days) | 1'000 $
PORTAL:
- Customer 1 | between 01/01/11 and 03/31/11 | (059 days) | 216.10 $
- Customer 2 | between 04/01/11 and 09/30/11 | (183 days) | 670.35 $
- Customer 3 | between 10/01/11 and 12/31/11 | (031 days) | 113.55 $
------
Everything is clear, except how i could calculate the duration of "time intersection"
I have all the data (dates) I need in these two tables, so i don't see why i would need a third one.. does anybody have any experience with such a problem?