Solved

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

Posted on 2004-03-23
8
797 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:denam
  • 4
  • 4
8 Comments
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663263
have yoou tried this:

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

cheers
0
 
LVL 1

Author Comment

by:denam
ID: 10663274
yes...of course.  i still get the same error
0
 
LVL 16

Accepted Solution

by:
ahmedbahgat earned 125 total points
ID: 10663282
the proper syntex should be

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

cheers
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 1

Author Comment

by:denam
ID: 10663313
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
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663331
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
 
LVL 1

Author Comment

by:denam
ID: 10663353
Thanks Ahmed.  Is there anyplace (link) where I could
read more about this?
0
 
LVL 16

Expert Comment

by:ahmedbahgat
ID: 10663382
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
 
LVL 1

Author Comment

by:denam
ID: 10663393
That works.  Thanks so much!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question