Dear Rhett:
First, I'd like to cover your definition of a "location". I presume that a
location is any unique combination of Address and CityStreet.
I would point out that this is tenuous at best. For example:
123 Main St.
123 Main St
123 Main Street
123 Main
Thes are 4 DIFFERENT locations. I believe you will find it virtually
impossible to prevent such variations if the columns Address and CityStreet
are freely typed.
Now, I understand you wish to exclude all locations that do not have an
entry for July 4, 2006. I would suggest a WHERE EXISTS() clause for this:
SELECT *
FROM tblMain T
WHERE EXISTS(SELECT *
FROM tblMain T1
WHERE T1.Address = T.Address
AND T1.CityStreet = T.CityStreet
AND T1.IncidentDate = #7/4/2006#)
John's solution earlier was quite similar, except he correlated on a column
"location" which you have subsequently clarified.
This does nothing to eliminate the difficulty with matching locations when
the CityStreet may differ, as I explained before. Short of qualifying all
addresses in the area, there may be no solution except to standardize the
entries programatically. Even then, it would be best to have a table of all
legal street names, perhaps with the address ranges on each one, and the
street suffix (St, Ave, Blvd, etc.)
Perhaps this may get you started. Please let me know.
Tom Ellison
Rhett_Y said:
Anyone....?? Aonyone please.. this has been driving me crazy trying to
figure this out....
R~
Rhett_Y said:
Hi all....
Preface: Main table called tblMain. Here are three of the fields that I
am
interested in setting this up for.
tblMain
Field 1: [IncidentDate]
Field 2: [Address] (actually street numbers)
Field 3: [CityStreet] (actually street name via lookup field off another
table)
Query based of the above tables.
What I want to query is this:
If location has an entry on July 4th, 2006 then it counts it, if the same
location has has another entry it counts it. If it only has a incident on
July 4th, 2006 an no other prior incidents do not display it... Does this
make sense.
So it would look something like this in a report generated off of the
query.
07/04/06 123 Main St
07/03/06 123 Main St
05/05/06 123 Main St
07/04/06 125 South St
07/02/06 125 South St
06/22/06 125 South St
But not:
07/06/06 125 south st
Thanks
R~