Discussion Locked

ADODC1 syntax error in query expression

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi I am getting the an error stating syntax error in query expression 'start date LIKE '2%". The code concerned lookes like this:

Adodc1.RecordSource = "Select * From projandpro Where start date LIKE '" & Text5 & "%';"

Can anyone help me modify this code so that I dont get this error. Another point of interest is that when I insert Letters into the text feild it works fine, however when a number is put the above mentioned error appears. Thanks

1 reply

by aureolin

"start date" should be "startdate", "start_date" or perhaps "[start date]". SQL is not recognizing the column name and throwing the syntax error. Check with your DBA (assuming you have one!) on what the column name really is. If it does contain a space, use the brackets like I did in my example above.

Steve G.

This discussion is closed to new replies.