-
Sql between and like
Hi Everyone!
I'm having a trouble with this line of code.
Rs.Open "SELECT * FROM Table WHERE Fname LIKE '%" & txtFname.Text & "%'" & " AND AVGRANK BETWEEN #1# AND #2#", con, adOpenDynamic, adLockOptimistic
How can i merge the 2?
I'm getting a syntax error in date in query expression.
Can somebody point me to the right direction?
TIA.
-
Re: Sql between and like
Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
1 is not a date, and neither is 2... so why have you marked them as dates?
For an explanation and examples of delimiters to use around values within SQL statements, see the article How do I use values (numbers, strings, dates) in SQL statements? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)
-
Re: Sql between and like
ok thanks for the input .