loddiemonster
New member
- Local time
- Yesterday, 16:08
- Joined
- Feb 4, 2014
- Messages
- 6
I hope this isn’t too confusing: I’m trying to create a query that will pull one of two options for one customer ID. My fields are: ID, lic_id (license ID) and exp_date. In this particular situation, it is possible for one customer ID to have two lic_id entered into my database. If that is the case, I want my query to look at the lic_id field, determine which one I want to see, and reflect that one lic_id in the results. For example: customer ID 100 has two entries in the lic_id field: 4 and 18. 4 means the customer is fully licensed and 18 means they have a provisional license. When the customer has completed the requirements to gain full licensure, I end date the provisional and enter the full license effective date the day after the Provisional’s end date. The full license is valid for two years. I tried creating a IIF function for the query, but it pulls both, and if I give that narrow query criteria, like “true” or “false”, it will only pull one or the other, and if a particular customer only has provisional at the time of the pull, I won’t be able to monitor that license because it’s not reflecting on my query.
Is there a way I can write the query to return only lic_id 4 if the same customer ID has an 18 AND if a customer ID only has 18, that will show on the same query?
Is there a way I can write the query to return only lic_id 4 if the same customer ID has an 18 AND if a customer ID only has 18, that will show on the same query?