Find and Sort with Exact or Closest Match (1 Viewer)

Mohsin Malik

Registered User.
Local time
Today, 15:13
Joined
Mar 25, 2012
Messages
175
I have an array that returns number of sites with [Zip code]. I want to parse [Zip code] and want the array to sorted with Exact Match or Closest Match? How this can be done?

Thank you
 

Ranman256

Well-known member
Local time
Today, 07:13
Joined
Apr 9, 2015
Messages
4,339
Make 2 queries, 1 for exact and 1 for close. Both can be opened from a form.
In a form put a textbox for the keyword, and a button to open the queries.
Q1, qsExact: select * from table where [zip]=forms!myForm!txtFind
Q2,qsClose: select * from table where [zip] like forms!myForm!txtFind & "*"

The button would run a macro with the 2 queries...
OpenQuery "qsExact"
OpenQuery "qsClose"
 

Users who are viewing this thread

Top Bottom