| *Lysander* 2005-11-11, 7:23 am |
| In article <AA8GZhr5FHA.1232@news-server>, mosesjhanna@hotmail.com=20
says...
> the "2" or "3" ... come in a variable
> what is the filtering code, please
I am no friend of using too many client-side filters, but you can do it=20
as well using a WHERE-clause in your query-statement, together with a=20
LIKE-clause.
As follows:
form.query1.sql =3D "select * from The_Table WHERE ID_field LIKE :id"
form.query1.params["id"] =3D ltrim(rtrim(form.entryfield1.value))+"%"
form.query1.requery()
In this case, your id would be given in "entryfield1" of the form.
The Placeholder "%" is needed for "unknown rest of the string".
So, entering "2" in the entryfield will show you all results with ids=20
2000 - 2999.
Entering "21" will show you all results with ids 2100 - 2199
Warning: Entering "2146" for example will not show you anything, because=20
there is not an additional character represented by the placeholder "%".
--=20
ciao,
Andr=E9
|