Harry,
Thank you very much for your reply.
You've already solved my problem very well.
The reason why there are two queues in my model is that there are two storage locations in reality, and I used two gates with queue to simulate this.
What I will do is to write an expression to select the gate with longest queue time and then release one item and then compare the longest queue time again.
Thank you again for your help.
Damon