Skip to content
Advertisement

Run a query based on the values returned by another query

Consider the tables:

If I were to run query1:

I want a query that would return all of the rows for open work orders in that date range (i.e. include the process, run, and ship). This would be the equivalent to what I want returned:

Therefore the desired output would be:

But I don’t want to specify each of the work orders returned from query1. Also, how could this work with a date range:

Advertisement

Answer

If you want all the rows for work orders that:

  • started on or before that date, and
  • ended on of after that date, and
  • include all three operations (process, run, and ship).

You can do:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement