p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: Inserting datetime into Access 2002


Message #1 by "Lukie" <lukes65@h...> on Mon, 3 Jun 2002 23:26:22
Hi

Plaese help. I am experiencing syntax errox in an SQL statement shown 
below. What could be the problem ?

INSERT INTO MP3_Music (Name, Artist, Tracks, Date) 
VALUES ('The best of', 'Abdullah Ibrahim', 13, #02/02/2002#)

I am using it from a Visual C# project. If I remove the datetime field 
everything else works fine.

Regards
/Luke
Message #2 by "Carnley, Dave" <dcarnley@a...> on Mon, 3 Jun 2002 17:24:00 -0500
can you use the word "Date" as a field name?  Isn't that a reserved word?
Try a different column name, like AlbumDate or something



-----Original Message-----
From: Lukie [mailto:lukes65@h...]
Sent: Monday, June 03, 2002 6:26 PM
To: Access
Subject: [access] Inserting datetime into Access 2002


Hi

Plaese help. I am experiencing syntax errox in an SQL statement shown 
below. What could be the problem ?

INSERT INTO MP3_Music (Name, Artist, Tracks, Date) 
VALUES ('The best of', 'Abdullah Ibrahim', 13, #02/02/2002#)

I am using it from a Visual C# project. If I remove the datetime field 
everything else works fine.

Regards
/Luke
Message #3 by "Gerald, Rand" <RGerald@u...> on Mon, 3 Jun 2002 17:47:45 -0500
Dave,

Since you are using Visual C# instead of Access, the SQL Server syntax 
not
the Access SQL syntax applies.

Replace the "#" around the data values with "'" (single quotes).

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: Carnley, Dave [mailto:dcarnley@a...]
Sent: Monday, June 03, 2002 5:24 PM
To: Access
Subject: [access] RE: Inserting datetime into Access 2002

can you use the word "Date" as a field name?  Isn't that a reserved 
word?
Try a different column name, like AlbumDate or something



-----Original Message-----
From: Lukie [mailto:lukes65@h...]
Sent: Monday, June 03, 2002 6:26 PM
To: Access
Subject: [access] Inserting datetime into Access 2002


Hi

Plaese help. I am experiencing syntax errox in an SQL statement shown
below. What could be the problem ?

INSERT INTO MP3_Music (Name, Artist, Tracks, Date)
VALUES ('The best of', 'Abdullah Ibrahim', 13, #02/02/2002#)

I am using it from a Visual C# project. If I remove the datetime field
everything else works fine.

Regards
/Luke

Message #4 by "Leo Scott" <leoscott@c...> on Mon, 3 Jun 2002 16:06:55 -0700
Try this:

INSERT INTO MP3_Music (Name, Artist, Tracks, [Date])

Date is a Reserved word is SQL and needs to be inside [] to get treated as a
field name.

|-----Original Message-----
|From: Lukie [mailto:lukes65@h...]
|Sent: Monday, June 03, 2002 11:26 PM
|To: Access
|Subject: [access] Inserting datetime into Access 2002
|
|
|Hi
|
|Plaese help. I am experiencing syntax errox in an SQL statement shown
|below. What could be the problem ?
|
|INSERT INTO MP3_Music (Name, Artist, Tracks, Date)
|VALUES ('The best of', 'Abdullah Ibrahim', 13, #02/02/2002#)
|
|I am using it from a Visual C# project. If I remove the datetime field
|everything else works fine.
|
|Regards
|/Luke
|

Message #5 by "Lukie" <lukes65@h...> on Tue, 4 Jun 2002 06:43:03
Problem fixed: Yes, I was using a reserved word "Date".

> can you use the word "Date" as a field name?  Isn't that a reserved 
word?
Try a different column name, like AlbumDate or something



-----Original Message-----
From: Lukie [mailto:lukes65@h...]
Sent: Monday, June 03, 2002 6:26 PM
To: Access
Subject: [access] Inserting datetime into Access 2002


Hi

Plaese help. I am experiencing syntax errox in an SQL statement shown 
below. What could be the problem ?

INSERT INTO MP3_Music (Name, Artist, Tracks, Date) 
VALUES ('The best of', 'Abdullah Ibrahim', 13, #02/02/2002#)

I am using it from a Visual C# project. If I remove the datetime field 
everything else works fine.

Regards
/Luke

  Return to Index