Using values from a previous search in a 1-Many relationship

Hi,

I have 2 tables, incident and incident_activities which have a 1-many relationship. The goal here is to extract some date fields from the incident_activities table given an incident id. The steps are as follow:

  1. My first query extracts a date field based on some defined conditions. This works fine.

  2. However, my second query is to extract another date field but this time, one of my conditions needs to use the date value info that I got from my first query. How can I acheive this?

Any pointers would be real great.

Many thanks,
Sharina


sharina (BOB member since 2004-06-24)

You have two options. You can use a subquery. Or, if you have version 6.1 or later, you can use Query on Query. Subquery would probably be more efficient.


MichaelWelter :vatican_city: (BOB member since 2002-08-08)