[RESOLVED] whats the error in the sql statment code?
Hi
whats the error in the sql statment code?
Code:
Adodc1.RecordSource = "select * from recept_Query where cheq_num like'" & Text8.Text & "' and where rec_type like'" & Text7.Text & "'"
ineed to make to condition in one selec statment like tha code?
thank yo
Re: whats the error in the sql statment code?
The keyword Where appears twice, once is enough.
Re: whats the error in the sql statment code?
You also dont have the LIKE wildcard character ("%") in your sql string unless you plan on adding it to the textbox input manually.
Re: whats the error in the sql statment code?
no ineed to check too fields in one time
Re: whats the error in the sql statment code?
Quote:
Originally Posted by
iyadd
no ineed to check too fields in one time
You can have multiple fields in your where clause
Re: whats the error in the sql statment code?
Re: whats the error in the sql statment code?
Code:
SELECT * FROM Table1 WHERE Field1 LIKE '%blah%' AND Field2 LIKE '%stuff%'
The corrected code for the posted question is ...
Code:
Adodc1.RecordSource = "select * from recept_Query where cheq_num like '%" & Text8.Text & "%' and rec_type like '%" & Text7.Text & "%'"
Re: whats the error in the sql statment code?
RobDog888 THanks you very much......its correct and run succefully.....
thank you too
iyadd
Re: whats the error in the sql statment code?
No prob. Glad to help :)
Ps, dont forget to Resolve your thread fromt he Thread Tools menu and choose "Mark Thread as Resolved" ;)
Re: [RESOLVED] whats the error in the sql statment code?