Error 3141 (SELECT Statement....)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello and thanks in advance.

I have an SQL string that doesnt seem to be working for whatever reason.

The SQL (as checked in the immediate window):

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.Description, FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

The Error:
Error 3141 (The SELECT Statement includes a reserved word or argument name
that is misspelled or missing, or the puncuation is incorrect)

I've got this identical SQL String in two other places in my code that run
without problem. I've double checked all spellings, field, table names, ect.
Any ideas on what might be causing this alarm would be greatly appreciated.

Thanks,
Jack
 
Description is a reserved word. If you cannot (or will not) change the name,
at least put square brackets around it. As well, you've got an unnecessary
comma after it.

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.[Description] FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

For a good discussion on what names to avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html
 
Thanks Douglas. I relized the extra comment right after I posted this (and
smacked myself the for not seeing it sooner). Had not realized that
Description was reserved. I will keep that list handy...

Douglas J. Steele said:
Description is a reserved word. If you cannot (or will not) change the name,
at least put square brackets around it. As well, you've got an unnecessary
comma after it.

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.[Description] FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

For a good discussion on what names to avoid in Access, see what Allen
Browne has at http://www.allenbrowne.com/AppIssueBadWord.html

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Dymondjack said:
Hello and thanks in advance.

I have an SQL string that doesnt seem to be working for whatever reason.

The SQL (as checked in the immediate window):

SELECT tblPrograms.Program, tblPrograms.Part, tblPrograms.prgClass,
tblPrograms.Operations, tblPrograms.Description, FROM tblPrograms WHERE
(tblPrograms.Part = 'PART2') ORDER BY tblPrograms.prgClass

The Error:
Error 3141 (The SELECT Statement includes a reserved word or argument name
that is misspelled or missing, or the puncuation is incorrect)

I've got this identical SQL String in two other places in my code that run
without problem. I've double checked all spellings, field, table names,
ect.
Any ideas on what might be causing this alarm would be greatly
appreciated.

Thanks,
Jack
 
Back
Top