my SQL Select is not working for me

  • Thread starter Thread starter Alpay Eno
  • Start date Start date
A

Alpay Eno

Hi, not exactly sure where to post this... What could be
wrong with my SQL statement below? I've been pulling my
hair out over this one. the table is called "schedules"
and I need to collect data from columns "5a", "5b", "6a",
and "6b" but I'm trying to start off simple and its not
working. My syntax looks correct to me but looks
different in the error, I tried a repsponse.write and it
looked good there. this is using access btw. Thanks for
the help

sql = "SELECT * FROM schedule WHERE period='1' AND
5a='math'"

I get :
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query
expression 'period='1' AND 5a='math''.

tia. Alpay
 
Just passing by... could it be possible the interpreter is having trouble
with a field name that starts with a number?

Steve
 
I would suggest that you need to wrap the field name 5a in brackets/braces.

... AND [5a] = 'math'"
 
Back
Top