URGENT: Missing semicolon (;) at end of SQL statement.

Hey Experts,

I have a table with the fields: id and idCustomer
An insert into this table ( nnOrder ) fails

insert into nnOrder (idCustomer) values (6) where id = 68

Error message is
Missing semicolon (;) at end of SQL statement.

what's the problem?

TIA
LVL 1
denamAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ahmedbahgatConnect With a Mentor Commented:
the proper syntex should be

INSERT INTO nnOrder ( idCustomer ) SELECT 6 AS Exp FROM nnOrder WHERE (((nnOrder .ID)=68));

cheers
0
 
ahmedbahgatCommented:
have yoou tried this:

insert into nnOrder (idCustomer) values (6) where id = 68;

cheers
0
 
denamAuthor Commented:
yes...of course.  i still get the same error
0
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
denamAuthor Commented:
your example worked where my query failed.
but I don't understand why.  I use mssql mostly.
this is the way i write an insert in tsql for mssql.

why does it fail in access?

Thanks!
0
 
ahmedbahgatCommented:
Each database engine, will use its own SQL language and because SQL lanugage is a standard technology, you will see that most of the statement are valid in all, like SELECT, INSERT INTO, however the whole SQL statment "after being composed" will be different from one platform to another


the way I write SQL under access, is to use the GUI then view the SQL equivelent from the menu bar, then copy it and this is how I got my answer from


cheers
0
 
denamAuthor Commented:
Thanks Ahmed.  Is there anyplace (link) where I could
read more about this?
0
 
ahmedbahgatCommented:
not really the way I discivered access sql statement is by creating any query I want "whatever comlicated it is" by using ACCESS GUI query builder, then from <View> menu bar I select <SQL View> and this will convert the GUI to the proper access sql equivlent

the more you do it the more you learn about it and how access deals with SQL statement

cheers
0
 
denamAuthor Commented:
That works.  Thanks so much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.