D
Dave Holmes
I have the following scenario:
A table called FACILITY linked, one-to-many, to a table called
LICENSES (each facility has a history of licenses). The licenses have
and EXPIRATION_DATE field and are linked, one-to-many, to various
other tables (INVOICES, etc).
I would like to have a query that returns the FACILITY, its latest
license (determined by the EXPIRATION_DATE) and the records linked to
that license.
I've tried returning the TOP 1 record in the query or a subquery of
the licenses, but that returns only one facility (the one with the
latest license expiration). MAX returns all of the licenses, with the
latest expiration date in each one.
Can this be done? Thanks!
A table called FACILITY linked, one-to-many, to a table called
LICENSES (each facility has a history of licenses). The licenses have
and EXPIRATION_DATE field and are linked, one-to-many, to various
other tables (INVOICES, etc).
I would like to have a query that returns the FACILITY, its latest
license (determined by the EXPIRATION_DATE) and the records linked to
that license.
I've tried returning the TOP 1 record in the query or a subquery of
the licenses, but that returns only one facility (the one with the
latest license expiration). MAX returns all of the licenses, with the
latest expiration date in each one.
Can this be done? Thanks!