Hello experts! I'm new here and hope you can help. This is a tricky problem I have:
I have a table of customers' phone numbers. A customer can have multiple phone numbers and multiple phone types (home, work, mobile, etc)... and any combination of such (2 home numbers and 1 work number, etc). They can designate which number is "preferred"... and each customer may have multiple preferred" numbers. Each record has a create date.
My problem:
I need a single row returned for each customer with a single preferred phone number.
- If a customer has one preferred phone number, then we will use that one.
- If they have multiple preferred phone numbers, then we use the most recent created one.
- If they have no preferred phone number(s) identfied, then we use the most recent created one.
I will upload a sample data file shortly (could not attach it directly to this post)
Thank you so much!!
https://filedb.experts-exchange.com/incoming/ee-stuff/8261-sample.xls