Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Syntax error in INSERT INTO statement

Guest
Apr 24, 2008 Apr 24, 2008
Hi, I have several form fields that are supposed to be inserted into an Access database. Several of the values are dates, which I created with dropdown menus that the users choose their values from, and then I used the CreateDate/CreateTime function to format them properly for Access date/time fields. However... I can't seem to get past this error! I have checked to be sure that I am not using any reserve words, and I don't think there are any misplaced commas, etc., although I could have missed something. I am guessing it has something to do with the date fields. I don't have any specific formatting on them in Access. Please help! Thanks :)
TOPICS
Getting started
562
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Apr 25, 2008 Apr 25, 2008
semi star gazer wrote
Yes, everything matches up
I do not think so. Do your parenthesis match?

although I am not sure where the "1899-12-30" is coming from on the createTime
Have a look at the Access documentation. It explains the signifigance of 1899-12-30
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_datetime.asp

'#Trim(form.datestamp)# #Trim(form.timestamp)#
Unlike the other form values, you are passing in the date and time stamp as a string. Why...
Translate
LEGEND ,
Apr 24, 2008 Apr 24, 2008
> INSERT INTO events ( eventName, eventDate, eventStartTime, eventEndTime,
> location, contactInfo, details, eventURL, sponsor, runStart, runEnd,
> dateSubmitted ) VALUES ( 'asdf', {ts '2008-01-02 00:00:00'}, {ts '1899-12-30
> 07:05:00'}, {ts '1899-12-30 07:10:00'}, 'asdf', 'asdf', 'sdf', '', '', {ts
> '2008-01-02 00:00:00'}, {ts '2008-01-03 00:00:00'}, '04/24/2008 10:19:57 PM'

Look at the SQL it's trying to execute. Is it syntactically correct?

--
Adam
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 25, 2008 Apr 25, 2008
Yes, everything matches up, although I am not sure where the "1899-12-30" is coming from on the createTime functions.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 25, 2008 Apr 25, 2008
semi star gazer wrote
Yes, everything matches up
I do not think so. Do your parenthesis match?

although I am not sure where the "1899-12-30" is coming from on the createTime
Have a look at the Access documentation. It explains the signifigance of 1899-12-30
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_datetime.asp

'#Trim(form.datestamp)# #Trim(form.timestamp)#
Unlike the other form values, you are passing in the date and time stamp as a string. Why not use ParseDateTime instead?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 25, 2008 Apr 25, 2008
LATEST
It was the parenthesis! Good call!

Also, I switched to ParseDateTime, and that is working as well. Thanks!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources