larkin_jack2
6th June 2002, 23:36
Does anyone out there have a baan query wildcard cheatsheet.
ie. How do i query for items that begin with the letters "Ma".
I am using verision BaanIVc4
Thank you
evesely
6th June 2002, 23:55
To find what you desire, you would do put something like this in your where clause:
fieldname like "Ma.*"
The .* syntax means zero or more occurrences of any character.
If you look in Baan for help on the expr.compile command, it will show you the syntax for string validation.
lbencic
6th June 2002, 23:58
In Easy SQL or Query by form? Or in regular code...
Try using the 'between' in the Query by form:
Item: between Ma and MaZZZZZZZZZZZZZZ
That should get them for you. Same is really true for a query in Easy SQL or Program Scripts, but you should use the 'in range' because it's more standard. Example:
Select tiitm001.*
from tiitm001
where tiiit001.item inrange "Ma" and "MaZZZZZZZZZZZZZZ"
or..more efficiently:
where tiitm001._index1 inrange {"Ma"} and {"MaZZZZZZZZZZZZZZ"}
Hope that helps.
Edited: I just saw Ed's post - that would work too !
~Vamsi
7th June 2002, 00:56
While Ed's method is elegant from a coding perspective, I believe it results in a "Full Table Scan". Until Baan makes "like" more effective keep away from it, if you can.
evesely
7th June 2002, 15:48
Since you mentioned a wildcard, I used one. Normally, I'd definitely go with Lisa's solution (for Vamsi's reasons). Pats on the back all the way around...:)
larkin_jack2
7th June 2002, 18:54
Can some one please correct my mistake.
I have attached a file for viewing.
Thankyou.
Also, instead of using Ma, I just M
Thank you all again.
gfasbender
7th June 2002, 19:01
Change the "Operator" to Like.
larkin_jack2
10th June 2002, 15:32
Thank you!