Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 15th, 2005, 09:42 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Missing semicolon?

Hi

I'm more familiar with MySQL but on this occasion need to run a query on Access as follows:

INSERT INTO [All Batches] (lName) VALUES ('Managing Partner') WHERE lName IS NULL;

When I run this I get a "Missing semicolon(;) at the end of SQL statement error" - but it's there! What am I doing wrong?

Also, am I using "IS NULL" correctly?

  #2 (permalink)  
Old February 15th, 2005, 11:51 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I dont think access will allow you to use Values with a Where clause.

To achieve your desired result you could use this -

INSERT INTO [All Batches] ( lname )
SELECT "Managing Partner" AS [Value]
FROM [All Batches]
WHERE ((([All Batches].lname) Is Null));

Jon
  #3 (permalink)  
Old February 15th, 2005, 11:57 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Are you trying to insert information or chang information within the table? It looks like you might be trying to update the IName where it is NULL. If so, you could use something like UPDATE [All Batches] SET IName = ("Managing Partner") WHERE IName IS NULL;

INSERT is used for appending records, so unless you are using the WHERE statement to filter where you are receiving the records from, there is no need for it.

Hope that makes sense, if not yell!!

Mike

Mike
EchoVue.com
  #4 (permalink)  
Old February 15th, 2005, 12:13 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks both you guys. Yes, I was trying to do an update. Wasn't thinking straight!

  #5 (permalink)  
Old February 15th, 2005, 12:26 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

No Problem, sometimes going from a world-class database server like MySQL to Access (which is a great program for what it does) can do a number on the brain cells!!

Mike
EchoVue.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
splitting up items separated by semicolon Condor76 XSLT 1 March 17th, 2008 05:14 PM
hi pls help on this semicolon data arvind@allfon XML 5 February 20th, 2007 08:09 AM
missing semicolon absolutelymk Access 2 May 5th, 2006 10:10 AM
What is missing? grstad SQL Language 11 March 6th, 2006 01:53 AM
what am i missing? m002864 Crystal Reports 0 July 6th, 2004 07:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.