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

SQL Update/Insert Reserved Words

Status
Not open for further replies.

trims30

Programmer
Dec 17, 2000
22
US
Having a problem with UPDATE and INSERT command.

Have database with fields named ID, Serial, By, Date

SQL Update Command:
UPDATE Transactions SET Serial="1234",By="Lee",Date="11/01/2009" WHERE ID=2101

Command fails due to improper syntax.

Traced it to fields "BY" and "DATE"
If I modify Database field Names to "sBY" and "sDATE" and change SQL accordingly it works fine.

Is there a way to use BY and DATE as field names?

Any help would be appreciated.

Lee
 
yes, there is a way to use BY and DATE as field column names

since you posted in the ANSI SQL forum, here's the ANSI SQL answer --

"BY" and "DATE"

this may or may not work in your particular database system

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Using MS Access database - tried "BY" - no luck - [BY] and [DATE] will work.

Thanks for pointing me in right direction.

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top