Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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?

Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
  #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!

Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:47 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.