I'm using the Levenshtein distance from here in my Access Database. Using the functionin a SELECT-Statement works when the function is in the field list. e.g.:
SELECT field, Levenshtein(field, 'Saturday')
FROM table
Where field
is a Text-Column (Access-VarChar). Now, I want to use the function in the where-clause as a condition like
SELECT field, Levenshtein(field, 'Saturday') as distance
FROM table
WHERE (Levenshtein(field, 'Saturday') < 5)
But all Access gives me is an error saying "Conflict with types". Its the same when using distance
in the consition instead of Levenshtein(field, 'Saturday')
.
The levenshtein-function is defined as Public Function Levenshtein(string1 As String, string2 As String) As Long
. So what did I do wrong?