Aiysha
asked on
matching negative number in access query.
How can I find records with same latitude and longitude values. please see attached image.
Thank you,
Capture.JPG
Thank you,
Capture.JPG
No image was attached to your question.
ASKER
Please see now.
I want to find all records that match lat and long
Thank you,
I want to find all records that match lat and long
Thank you,
You could make the fields both text, concatenate them in another column, sort on the new column and then add another column that searches for duplicates. = IF(A2=A1, "Duplicate",""). Probably not the best way, but should work.
ASKER
I am doing this in access query
I don't see any matches in the example.
Probably something is missing in the question...the concatenation proposed from Tom should be a viable solution...
If the problem is positive/negative then using ABS to turn everything to positive
Use a query like this to identify the dupes:
Select Latitude, Longitude
From Table_Property
Group By Latitude, Longitude
Having Count(*) > 1
The first thing you need to do is determine the number of duplicate records you have for each Lat/Long combination. Stealing from Gustav's query:
You can sort the count if you want to, or just get the ones with more than one record as Gustav's query does.
Once you get the query you want, you can link it to your table by Lat and Long and select the records with the Count column included.
Modify your query to get whatever you need.
Select Latitude, Longitude, COUNT(*) AS RecCnt
From Table_Property
Group By Latitude, Longitude
The gives you the number of records for each lat/long combination.You can sort the count if you want to, or just get the ones with more than one record as Gustav's query does.
Once you get the query you want, you can link it to your table by Lat and Long and select the records with the Count column included.
Modify your query to get whatever you need.
Yes, ...it is not clear what you are defining as a "Match"
because your question title is:
"matching negative number"
...But later you just say:
"I want to find all records that match lat and long", (without any reference to positive or negative)
...We just need to be clear, ...because what happens in the case that there are two matching "Positive" values...? (or some other "Matching" combination)
What in the following would represent a "Match"
Latitude=45.000 Longitude =45.000
Latitude=45.000 Longitude =-45.000
Latitude=-45.000 Longitude =-45.000
Latitude=-45.000 Longitude =45.000
I am leaning with John (Possibly use the ABS() function):
SELECT Latitude, Longitude, IIf(Abs([Latitude])=Abs([L ongitude]) ,"Match"," No Match") AS [Match]
FROM Table_Property;
...gets you an output similar to this:
JeffCoachman
because your question title is:
"matching negative number"
...But later you just say:
"I want to find all records that match lat and long", (without any reference to positive or negative)
...We just need to be clear, ...because what happens in the case that there are two matching "Positive" values...? (or some other "Matching" combination)
What in the following would represent a "Match"
Latitude=45.000 Longitude =45.000
Latitude=45.000 Longitude =-45.000
Latitude=-45.000 Longitude =-45.000
Latitude=-45.000 Longitude =45.000
I am leaning with John (Possibly use the ABS() function):
SELECT Latitude, Longitude, IIf(Abs([Latitude])=Abs([L
FROM Table_Property;
...gets you an output similar to this:
JeffCoachman
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.