D
Darren
I have a table that is a list of Properties, Owners and DateofOwnership
I have a table of Permits that only has a date to link to the Owners.
I must get the owner as of the date of the permit.
I was able to do this, but it is extremely slow (actually takes a couple of
minutes to return 7000 records). What would be a quicker way?
This is the query....
SELECT (SELECT [OwnerID]
FROM PropertyOwners P1
WHERE (P1.PropertyID=Permits.PropertyID) AND (P1.ODate)=
( SELECT max(oDate) FROM PropertyOwners WHERE
(((PropertyOwners.PropertyID)=P1.PropertyID) AND
((PropertyOwners.ODate)<=Permits.Idate)); )
) AS OwnerID, *
FROM Permits;
I have a table of Permits that only has a date to link to the Owners.
I must get the owner as of the date of the permit.
I was able to do this, but it is extremely slow (actually takes a couple of
minutes to return 7000 records). What would be a quicker way?
This is the query....
SELECT (SELECT [OwnerID]
FROM PropertyOwners P1
WHERE (P1.PropertyID=Permits.PropertyID) AND (P1.ODate)=
( SELECT max(oDate) FROM PropertyOwners WHERE
(((PropertyOwners.PropertyID)=P1.PropertyID) AND
((PropertyOwners.ODate)<=Permits.Idate)); )
) AS OwnerID, *
FROM Permits;