T
TooOldToLearn via AccessMonster.com
I have a dispatch program that uses a parent/child query in which the child
records have date fields. The two tables are related by a common field
called ProNum and the child records are differentiated by a field called
StopNum. The child records may or may not have different date values for
each of the stops.
I would like to generate a report by inputing a date range for a selection
criteria. The resulting records would contain not only the "Stops" that
occurred within the date range but also the stops that were related by the
same Pronum.
For example:
Order. Pronum = 1111
Stop.Pronum = 1111 Stop.StopNum = 1 Stop.StopDate = 1/1/05
Stop.Pronum = 1111 Stop.StopNum = 2 Stop.StopDate = 1/2/05
Stop.Pronum = 1111 Stop.StopNum = 3 Stop.StopDate = 1/3/05
I want to see all Orders that have a Stop with the date of 1/2/05 and I want
to see all all of the Stops that were made on those Orders. My report would
show all three records from the example even if the selection range were
limited to 1/2/05. It would show no records that didn't have at least one
stop on 1/2/05.
I think what I need is to run a query that gets all of the ProNums that have
Stops with a matching date and then use the resulting list of ProNums to
fetch the rest of the stops.
Is there a way to use the "IN" clause to look at query results of the first
query and return all matching records?
Thanks in advance.
toooldtolearn
but still trying
records have date fields. The two tables are related by a common field
called ProNum and the child records are differentiated by a field called
StopNum. The child records may or may not have different date values for
each of the stops.
I would like to generate a report by inputing a date range for a selection
criteria. The resulting records would contain not only the "Stops" that
occurred within the date range but also the stops that were related by the
same Pronum.
For example:
Order. Pronum = 1111
Stop.Pronum = 1111 Stop.StopNum = 1 Stop.StopDate = 1/1/05
Stop.Pronum = 1111 Stop.StopNum = 2 Stop.StopDate = 1/2/05
Stop.Pronum = 1111 Stop.StopNum = 3 Stop.StopDate = 1/3/05
I want to see all Orders that have a Stop with the date of 1/2/05 and I want
to see all all of the Stops that were made on those Orders. My report would
show all three records from the example even if the selection range were
limited to 1/2/05. It would show no records that didn't have at least one
stop on 1/2/05.
I think what I need is to run a query that gets all of the ProNums that have
Stops with a matching date and then use the resulting list of ProNums to
fetch the rest of the stops.
Is there a way to use the "IN" clause to look at query results of the first
query and return all matching records?
Thanks in advance.
toooldtolearn
but still trying