PC Review


Reply
Thread Tools Rate Thread

What is the correct sql syntax for all sql statements?

 
 
=?Utf-8?B?bWF0cjhlcg==?=
Guest
Posts: n/a
 
      24th Feb 2006
I can't find anywhere the correct syntax to use now with office 2003 SP2. I
have a simple asp page that inserts a new record into a database with many
fields. This used to work:
INSERT INTO Results (Request, Cnum, user, location, date_needed) VALUES
(::Request::,::Cnum::,::,::location::,::date_needed:

Now it doesn't. When I hit the Verify Query button it says there are errors.
When I actually use it on the website it says the operation failed. I need
the correct syntax to use for ALL statement types. This page only has Select:
http://support.microsoft.com/kb/907307
Please help. Thank you very much.
 
Reply With Quote
 
 
 
 
Jon Spivey
Guest
Posts: n/a
 
      24th Feb 2006
Hi,
You need quotes around text values and # # around dates, eg
INSERT INTO Table
(NumberField, DateField, TextField)
VALUES
(23, #2006-01-24#, 'Some Text')

--
Cheers,
Jon
Microsoft MVP

"matr8er" <(E-Mail Removed)> wrote in message
news:BF188257-197C-400A-AC4E-(E-Mail Removed)...
>I can't find anywhere the correct syntax to use now with office 2003 SP2. I
> have a simple asp page that inserts a new record into a database with many
> fields. This used to work:
> INSERT INTO Results (Request, Cnum, user, location, date_needed) VALUES
> (::Request::,::Cnum::,::,::location::,::date_needed:
>
> Now it doesn't. When I hit the Verify Query button it says there are
> errors.
> When I actually use it on the website it says the operation failed. I need
> the correct syntax to use for ALL statement types. This page only has
> Select:
> http://support.microsoft.com/kb/907307
> Please help. Thank you very much.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Statements/Syntax Anthony Microsoft Access VBA Modules 4 3rd Nov 2006 08:46 AM
SQL Statements/Syntax Anthony Microsoft Access 4 3rd Nov 2006 08:46 AM
SQL Statements/Syntax Anthony Microsoft Access External Data 4 3rd Nov 2006 08:46 AM
SQL Statements/Syntax Anthony Microsoft Access Queries 4 3rd Nov 2006 08:46 AM
SQL Statements/Syntax Anthony Microsoft Access Form Coding 3 3rd Nov 2006 08:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.