I am using an SQL query to insert data from an excel worksheet into an Access database. I put all the data that I want from the worksheet into variables:
rw
Why not make use of date/time field to include test time?
It is best to format dates, assuming that b5 is a date type:
testDate = Format(Range("b5").Value,"yyyy/mm/dd")
You will end up with text, but this is not important.
stSQL1 = "INSERT INTO [Friction Tests] ([Runway Number], [Runway Test Side], " _
& "[Test Date], [Test Time], [1/3], [2/3], [3/3], [Average]) " _
& "VALUES ( " & rwyNumber & ",#" & testDate & "#,#" & testTime _
& "#," & rwySide1 & "," & firstThird1 _
& "," & secondThird1 & "," & thirdThird1 _
& "," & averageFriction1 & ")"
If any of the fields are text, the value will have to be surrounded by single quotes or two double quotes, in a similar way to date and time.
I strongly recommend getting rid of spaces in field (column) and table names.