like use

mikeo1313

Registered User.
Local time
Today, 03:12
Joined
May 27, 2010
Messages
50
I'm nearly done with an action query that will make category associations.


I have a table for the categories and another to relate from.


My trouble is with the where clause of my insert into values expression.


Lets say for example I have the following variants

deep fry
deep fryer
deep-fryer
deep frying
deep-fryng


How would I catch them?


where tblrec.categories like "deep*fry*"


Thank you
 
I agree with you. Deep* would also do it but would catch deep Freezers as well.

If this is an on going issue, Murphy's law say's there will be one person who will find a way of typing in a Deep Fryer to by pass your "Catch All"
Do you have, or need, a way to find any Items that don't have a category association when the task is over?
 
in the back of my mind I imagined once I finished categorizing I'd have to address the none category. Now that I think of it, is there a function that would help that you can think of, or have used?
 
If you are automating the process then the final act would be to check for null in category associations.
Haven't done such a thing before but often have to check data for errors and find best manual way is to sort on the field and the first entries hold the empty spaces. (Text fields)
If you have a field for Category Association then any items missed would have null in this field.
At the end of the day, your data base will depend on "Intelligent" operators to A. Enter Data correctly and B. Report any errors ie, Deep Freezer in the deep fryer category. The delivery man may notice a difference - although you will be surprised :eek:
 
the simplest way it seems I can pull this off is 1st adding a blank category for each recipe, then updating categories based on various criterias,,, and like you said for those missing probably assign them a none.

as far as the other matters there really isn't an issue besides the intelligent part.. hehe, almost nothing.
 
in this expression

where tblrecipes.categories like tblcategorias.categorias

how do I integrate the asterisk? I tried a variety of ways, I either get a syntax error or 0 affected rows, currently the statement as is only gives results where the text contained in categories is all by itself, so very little associations are achieved.
 
Does this help

SELECT TblOrders.OrderNumber, TblOrders.OrderDate, TblOrderDetail.OrderID
FROM TblOrders INNER JOIN TblOrderDetail ON TblOrders.OrderNumber = TblOrderDetail.OrderID
WHERE (((TblOrderDetail.OrderID) Like "*"));
 
Normally one would use something like"
Where [somefield] Like "*" & "deep" & "*" & "fry" & "*"

But unfortunately that will also find:

"take the icecream out of the deep freezer and add it to the lamb's fry"
 
Actually the concatenation I used above is superfluous. Only required when the search string is a field reference of tempvar as in:

Like "*" & [searchstring1] & "*" & [searchstring2] & "*"

Otherwise what I wrote is exactly the same as
Like "*deep*fry*"

A question mark gives you a single character so this will find deep and fry separated by exactly one character:
Like "*deep?fry*"

You can test for exactly one of a group of characters like this:
Like "*deep[- ]fry*"

However you are up against a myriad of potential spelling errors. You might be able to make a function that tested for the distance separating Soundex variants of the two words.

http://allenbrowne.com/vba-Soundex.html
 

Users who are viewing this thread

Back
Top Bottom