Hi,
I want to query one of my table based on a textbox in a form: if the user enters nothing in it, I want to return all records; if he enters something, I want to filter the records using his value.
The filter is applied on a numeric column. How can I do that in a query? I'm presently using a LIKE clause, which is probably not the best solution since the column is numeric..:
SELECT * FROM myTable WHERE [id] LIKE IIF([txtId]="", "*", [txtId])
And my query doesn't return records with empty [id] because of the "*" filter..
Thanks!
I want to query one of my table based on a textbox in a form: if the user enters nothing in it, I want to return all records; if he enters something, I want to filter the records using his value.
The filter is applied on a numeric column. How can I do that in a query? I'm presently using a LIKE clause, which is probably not the best solution since the column is numeric..:
SELECT * FROM myTable WHERE [id] LIKE IIF([txtId]="", "*", [txtId])
And my query doesn't return records with empty [id] because of the "*" filter..
Thanks!