my SQL Select is not working for me

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
 
G

Guest

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

Steve
 
J

John Spencer (MVP)

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top