Solved

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

Posted on 2004-03-23
8
790 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
 
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
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…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now