Dim strSQL Syntax Issue

burrina

Registered User.
Local time
Today, 11:43
Joined
May 10, 2014
Messages
972
I'm missing something here but don't know what.
The Data Types match and they are in order. I get a syntax error.

PHP:
      strSQL = "INSERT INTO tblHour (Hours, WorkDate, SickDay, SickDte) VALUES (" _
   Me.AbsenceHrsID & ",#" & Format(Me.AbsenceDteTo, "yyyy-mm-dd") & "#,True,#" _
   Format(Me.AbsenceDteTo, "yyyy-mm-dd") & "#)"
CurrentDb.Execute strSQL, dbFailOnError
 
I'm missing something here but don't know what.
The Data Types match and they are in order. I get a syntax error.

PHP:
      strSQL = "INSERT INTO tblHour (Hours, WorkDate, SickDay, SickDte) VALUES (" _
   Me.AbsenceHrsID & ",#" & Format(Me.AbsenceDteTo, "yyyy-mm-dd") & "#,True,#" _
   Format(Me.AbsenceDteTo, "yyyy-mm-dd") & "#)"
CurrentDb.Execute strSQL, dbFailOnError

The date format expected by an SQL statement is "mm/dd/yyyy"

Best,
Jiri
 
it might be the sick day bit, with a text of true

I would either do this

"# , " & -1 & " , #"

or this

"# , " & True & " , #"
 

Users who are viewing this thread

Back
Top Bottom