Track when employees change depot

Brilliant! I think I've done it properly. This is what I tried:
attachment.php


and:

attachment.php


Thanks for your help.
 

Attachments

  • SubQuery.png
    SubQuery.png
    19.3 KB · Views: 262
  • FinalQuery.png
    FinalQuery.png
    15.7 KB · Views: 271
Just because I'm pedantic--I would bring in Depot_Name into DepotTraining instead of Depot_ID. Then in the main query, you don't need tblDepots, you just use Depot_Name from DepotTraining.
 
I've chosen to use DepotID only because I am wanting to sort by the ID, but show the depot name. And in my full database I have more fields that I may eventually want to sort/filter by.

Since posting those pictures I have realised that the sub-query doesn't need to know about tblEmployees and tblDepots so I have removed them.

Again thanks for your help. I always struggle with joins and sub-queries, but I've learnt a lot.
 

Users who are viewing this thread

Back
Top Bottom