Forum Discussion

GuidoPinares's avatar
GuidoPinares
Helper I
3 years ago
Solved

Track time activity

Hello Community,

 

Thanks so much for taking the time to review this, I have 3 tables as follows:

 

Sales (SaleID, DateOfSale, Customer, Quantity)

Activity (SaleID, DateOfActivity, Customer)

Customer (CustomerID, FullName)

 

I would like to track the activities that precedes a Sale, this means that someone from the company contact our customer prior to a Sale occurs, in the DB there are records when even though a customer has an activity related they never do a purchase, I want to get just those activities that has a Activity BEFORE the Sale occurs, If theres more than one Activity previous to the sale should be also consider.

 

 

For example in the previous image, a sale occurs on 2/4/2023 and also an Activity prior to that Sale on 2/1/2023. I want to consider only those cases, Any activity that occurs prior to a Sale and highlighted in a Matrix just as in the image. 

 

Thanks for any recommendation or help.

 

2 Replies