SQL & Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to update a record in VBA by using the DoCmd.RunSQL command. The
string I am trying to use is:

"UPDATE tbl_building SET checkintime = " & me!checkintime & " WHERE building
= 'GG';"

Unfortunately, there is a syntax error with the time bit (me!checkintime is
stored as format hh:mm:ss AM/PM), and as much as I have experimented, I
cannot get the SQL to work. Any suggestions on how to put a time value into
SQL?

Thanks!

Nick
 
"UPDATE tbl_building SET checkintime = #" & me!checkintime & "# WHERE
building = 'GG';"
I think you need the # for time and date.
 
Try this, adding # to a date/time parameter

"UPDATE tbl_building SET checkintime = #" & me!checkintime & "# WHERE
building
= 'GG';"
 
Back
Top