machinetech
New member
- Local time
- Today, 16:58
- Joined
- Jun 10, 2019
- Messages
- 7
I have a parent table that contains a list of all of the machines my company owns (Table 1). There is another table that contains all of our maintainence records(Table 2). From the maintainence records table I then create a query (Query 1) that predicts the next maintainence date based off of the most recent entry for that specific machine.
However there are some machines that have never been maintainanced, so I have identified these machines by using an unmatched query between Table 1 and Query 1. From the unmatched Query I created a Query that calculates when these machines should receive there first service (Query 2).
Now essentially what I want is a query that contains all of the machines with their expected maintainance dates. I have tried several different iif statements without any luck.
I'm thinking maybe if I could make a query of Table 1, and say that if the machine exists in Query 1 then the field will equal true, and if not false. Then I would be able to make an iif, if the field is true, pull date from query 1, if false query 2.
Sorry for being long winded, but I figured it would be best to give the whole scenario rather than just the 2 queries I have. I can post sample data in a reply if needed. Thanks for any advice.
However there are some machines that have never been maintainanced, so I have identified these machines by using an unmatched query between Table 1 and Query 1. From the unmatched Query I created a Query that calculates when these machines should receive there first service (Query 2).
Now essentially what I want is a query that contains all of the machines with their expected maintainance dates. I have tried several different iif statements without any luck.
I'm thinking maybe if I could make a query of Table 1, and say that if the machine exists in Query 1 then the field will equal true, and if not false. Then I would be able to make an iif, if the field is true, pull date from query 1, if false query 2.
Sorry for being long winded, but I figured it would be best to give the whole scenario rather than just the 2 queries I have. I can post sample data in a reply if needed. Thanks for any advice.