John Zelmer
Registered User.
- Local time
- Today, 21:43
- Joined
- May 13, 2015
- Messages
- 39
Simplified, I have the following table:
ID Registration* (primary key)
ID Customer
Registration date
Registration type
so where a customer can have 1-n registrations.
I'm now looking for a way do calculate the average number of days between the consecutive registrations per customer, which of course only can be done if they have more than one registration. For example if customer A registers on 01-01-2015, 09-01-2015 (8 days) and 25-01-2015 (16 days), the average number of days would be 12. I need the actual number of days per comparison as well.
Since I need to compare data from different records in a specific order: Can this somehow be done in one or more queries of should I write code for this?
Thanks in advance for any suggestions!
John
ID Registration* (primary key)
ID Customer
Registration date
Registration type
so where a customer can have 1-n registrations.
I'm now looking for a way do calculate the average number of days between the consecutive registrations per customer, which of course only can be done if they have more than one registration. For example if customer A registers on 01-01-2015, 09-01-2015 (8 days) and 25-01-2015 (16 days), the average number of days would be 12. I need the actual number of days per comparison as well.
Since I need to compare data from different records in a specific order: Can this somehow be done in one or more queries of should I write code for this?
Thanks in advance for any suggestions!
John