♥14steve14 Posted May 6, 2022 Share Posted May 6, 2022 Using Phoenix 1.7.11 I am trying to find a way of listing all customers who are signed up on my website, but who have not purchased anything in the last 6 years. This is something I am thinking about to comply with GDPR and not keeping data or information longer than we need to. It may also remove lots of unneeded customer info from the database I have SQL to find a list of customers listed by last order date but need a way to refine that list to show those that have never bought from a specific date. The SQL code I have is SELECT customers_name, o.customers_email_address, date_purchased FROM orders o ORDER BY date_purchased Is there any way of adapting that so that it shows customers with no orders after a certain date. One way I have thought of is to find the last order date for each customer, but have no idea if that is even possible in SQL Quote REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.