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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when selecting a column name called LINENO

Status
Not open for further replies.

jmueller

MIS
Oct 9, 2001
57
US
There must be an easy answer to this one! Can somebody please tell me how I can get around this problem:

I'm simply trying to perform the following select stmt:

Select PONO,LINENO,MATNO from bbpoline

And I get the following error:

Incorrect syntax near the keyword 'LINENO'.

LINENO is a function (turns blue in the stmt) so i'm sure this is the problem but how do I get around it?

Thanks for any help you can give me.

Jack.
 
Use square brackets [ ] around lineno.

Select PONO,[LINENO],MATNO from bbpoline

-SQLBill
 
Jmueller:

I don't see that it's a reserved word by Access, but what I usually do in that case is surround the fields with brackets [ ], and if that doesn't work I re-name the item.

Hope this helps.

Jim

"Get it right the first time, that's the main thing..." [wavey]
 
Thanks SqlBill. I really appreciate your quick response.
 
You're welcome. Have a great weekend!

Jim

"Get it right the first time, that's the main thing..." [wavey]
 
Jim,

You said "I don't see that it's a reserved word by Access". But it IS a reserved word in Microsoft SQL Server which is what this forum is for.

-SQLBill
 
Bill

Didn't realize that, but the bracket solution works for both Access and SQL.

I was clicking between several Access forums and this one, not realizing that I stayed in the SQL forum. I'll pay better attention next time! [thumbsup2]

Jim

"Get it right the first time, that's the main thing..." [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top