Hi,
I wonder if somebody could please help with a query I am trying to figure out.
Basically I have 2 tables, one named “Customer” and the other named “Cust_Refer”
The (Customer) table is a list of customers who have purchased a product containing fields “EntryID” “Customer_Name” and “Entry_Date”
As they have become a customer I now wish to offer them an option to refer new customers to me in exchange for a reward. Currently the customers only have the opportunity to refer one person (at some later date, I will look at allowing them to refer more than one person)
The 2nd table (Cust_Refer) contains the fields “ReferID” “CustRefer_Name” “Referral_Name1” and “Refer_Date” basically listing the referral they have sent and when they sent it.
I have also created a query (Converted_Referrals) to list all the people who have been referred who have since become a customer. As such it lists all the customers who sent a referral that have now converted to a customer themselves. This way I can see which customers who sent a referral now need to be credited with a reward.
The problem I am encountering is when 2 or more customers, refer the same person as there can only be one reward per converted customer. The fairest way of doing this is to offer the reward to the person who sent the referral the earliest.
For example
Paul S from Leeds sent a referral:- Bill C from York on the 01/06/2018
Richard W from Manchester also sent the same referral Bill C from York but on 08/06/2018
Bill C from York then became a customer and so a reward is due to the person who referred him.
From this example Paul S from Leeds would be credited with the reward as he sent the referral earlier.
In my current query it lists all people who have been referred and converted to customers (including the duplicate referrals), so basically, I am wanting to filter out those duplicates whose referral date is not the earliest for that particular referral. In the example above Richard W from Manchester would not show in the query list.
I have placed a sort on “Referral_Name1” and a sort on “Refer_Date” so it will place the referrals in ascending order depending on when they were sent.
I wondered it was possible to add a 1 (in a separate field) to the first time a person is referred, 2 to the 2nd time the same person is referred and so on.
That way all unique referrals would have a 1 and any duplicate referrals would have a 2 or 3 or 4 depending on how many times they have been referred to me.
I could then set the criteria to only display the referrals who have a 1.
The problem I have is that I don’t know how to add the 1 or 2 or 3 etc in a separate field next to the particular record, I’m sure it will be quite straight forward, but it is baffling me, so any advice would be hugely appreciated.
The other criteria I would also need to add is the “Refer_Date” must be greater than or equal to the “Entry_Date” this means that a person has to become a customer first before they can send any referrals.
I have included the basic database, so you are able to see what I have done so far. If you can please help as I am just on the early road of getting to grips with Access and would like to develop my own knowledge more to the level I feel comfortable with.
Many thanks
Paul
I wonder if somebody could please help with a query I am trying to figure out.
Basically I have 2 tables, one named “Customer” and the other named “Cust_Refer”
The (Customer) table is a list of customers who have purchased a product containing fields “EntryID” “Customer_Name” and “Entry_Date”
As they have become a customer I now wish to offer them an option to refer new customers to me in exchange for a reward. Currently the customers only have the opportunity to refer one person (at some later date, I will look at allowing them to refer more than one person)
The 2nd table (Cust_Refer) contains the fields “ReferID” “CustRefer_Name” “Referral_Name1” and “Refer_Date” basically listing the referral they have sent and when they sent it.
I have also created a query (Converted_Referrals) to list all the people who have been referred who have since become a customer. As such it lists all the customers who sent a referral that have now converted to a customer themselves. This way I can see which customers who sent a referral now need to be credited with a reward.
The problem I am encountering is when 2 or more customers, refer the same person as there can only be one reward per converted customer. The fairest way of doing this is to offer the reward to the person who sent the referral the earliest.
For example
Paul S from Leeds sent a referral:- Bill C from York on the 01/06/2018
Richard W from Manchester also sent the same referral Bill C from York but on 08/06/2018
Bill C from York then became a customer and so a reward is due to the person who referred him.
From this example Paul S from Leeds would be credited with the reward as he sent the referral earlier.
In my current query it lists all people who have been referred and converted to customers (including the duplicate referrals), so basically, I am wanting to filter out those duplicates whose referral date is not the earliest for that particular referral. In the example above Richard W from Manchester would not show in the query list.
I have placed a sort on “Referral_Name1” and a sort on “Refer_Date” so it will place the referrals in ascending order depending on when they were sent.
I wondered it was possible to add a 1 (in a separate field) to the first time a person is referred, 2 to the 2nd time the same person is referred and so on.
That way all unique referrals would have a 1 and any duplicate referrals would have a 2 or 3 or 4 depending on how many times they have been referred to me.
I could then set the criteria to only display the referrals who have a 1.
The problem I have is that I don’t know how to add the 1 or 2 or 3 etc in a separate field next to the particular record, I’m sure it will be quite straight forward, but it is baffling me, so any advice would be hugely appreciated.
The other criteria I would also need to add is the “Refer_Date” must be greater than or equal to the “Entry_Date” this means that a person has to become a customer first before they can send any referrals.
I have included the basic database, so you are able to see what I have done so far. If you can please help as I am just on the early road of getting to grips with Access and would like to develop my own knowledge more to the level I feel comfortable with.
Many thanks
Paul