INSERT INTO and UPDATE date field 
Author Message
 INSERT INTO and UPDATE date field

I am having problem with SQL statement INSERT INTO and
UPDATE with date field in VB 5.0.

Example

INSERT INTO sale (date, InvNo) VALUES (#2/3/1999#, '1234')

UPDATE sale SET date = #2/3/1999#

'sale' is a tablename and 'date' is a fieldname with date
type.

VB always prompt me syntax error in SQL statement.
It works fine if I don't use date field.

It is ok with SELECT statement, but not INSERT INTO and
UPDATE.

eg.
SELECT * FROM sale WHERE date = #2/3/1999#

Can anyone point out the syntax error.

Thanks in advance for any help.
Sorry if my question seems trivial.


Thank you.

C.J. Yap

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Sun, 06 Jan 2002 03:00:00 GMT  
 INSERT INTO and UPDATE date field
date is a reserved word try using [date] instead :

INSERT INTO sale ([date], InvNo) VALUES (#2/3/1999#, '1234')

Bill

Quote:

>I am having problem with SQL statement INSERT INTO and
>UPDATE with date field in VB 5.0.

>Example

>INSERT INTO sale (date, InvNo) VALUES (#2/3/1999#, '1234')

>UPDATE sale SET date = #2/3/1999#

>'sale' is a tablename and 'date' is a fieldname with date
>type.

>VB always prompt me syntax error in SQL statement.
>It works fine if I don't use date field.

>It is ok with SELECT statement, but not INSERT INTO and
>UPDATE.

>eg.
>SELECT * FROM sale WHERE date = #2/3/1999#

>Can anyone point out the syntax error.

>Thanks in advance for any help.
>Sorry if my question seems trivial.


>Thank you.

>C.J. Yap

>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
>The fastest and easiest way to search and participate in Usenet - Free!



Mon, 07 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How do you update a null date into an access table date field

2. Want to auto update date field based on adding check in another field

3. Update command not inserting correct date

4. inserting character in an access field by using an update query

5. Update/Insert into An Access2000 Memo field

6. Inserting current date into a contact's note field

7. Insert current date into form fields

8. Insert date and time field into MS Access with SQL

9. Problem inserting record with date field

10. Inserting a date field into SQL

11. INSERT query fails with date field

12. How to Insert a Record with a Date Field into FoxPro

 

 
Powered by phpBB® Forum Software