Hi,
I want to search Mysql Data using search between and a criteria, for example,
I have a database list of cars, I want to find specific brand based for 2 dates data search.
I have brand,
Volvo
mustang
bmw
I want to get the result of ‘bmw’ in specific date.
I tried this code, but no work,
sql="SELECT * FROM "+cmbOutlet.Text+"_report"+" WHERE Date BETWEEN'" + date1.text + "' AND '" + date2.text +"' AND carBrand ='" + TextField1.text + "'"
You need to check the database.errormessage to see what’s wrong. I’d guess that the date values are not in the format MySQL expects them (they need to be in “SQL”-format, e.g. ‘2017-06-23’).
the result is shows, while I do type the criteria completely. how to make it work with criteria content.? I meant, if I type ‘musta’ for example, the result contains that word, shows on the list.