Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tables with reserved names

Status
Not open for further replies.

Kevin123456

Technical User
Jan 14, 2002
35
0
0
GB
Hi,

I have an MS Access database with the table name 'All'. When I try to select it in a query (select * from all) then I get a syntax error, presumably 'All' is a reserved keyword. If I rename the table 'Alls' then the select is no problem. Ideally I would like to avoid having to rename the table as following on from this I have two fields in the table called 'Group' and 'Year Group'. When doing an order by 'Group' works with no problems but the field 'Year Group' doesn't sort the data. They are both text fields of 50 characters in length. Is it possible to select from the 'All' table and order by the 'Year Group' field?

Any help gratefully appreciated.
 
Kevin,

I would place Year Group ins square brackets, i.e. [Year Group]. If that doesn't work, then GROUP may be reserved word also.

fengshui_1998
 
AFAIK "All" and "Group" are reserved words in almost all sql databases. Also, it is usually not a good idea to have whitespace in the name of a field.
 
Thanks for the advice, the square brackets worked a treat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top