projecttoday
Programmer
I have the following:
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE starttime = #" & Loopdate & "# AND personid = " & personid
starttime is a Date/Time field which contains a Date/Time (I know the name is a little misleading.) But for this update I want to disregard the time portion. If I use
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE Format(starttime,""mm/dd/yyyy"") = #" & Loopdate & "# AND personid = " & personid
it doesn't work. If I use
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE DateValue(starttime) = #" & Loopdate & "# AND personid = " & personid
it doesn't work. I'm sure the problem is with the date because
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE personid = " & personid
(where I'm leaving out the date check) performs an update but does it for all dates which is not what I need.
How can make this update query select based on the date part of field starttime?
Robert
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE starttime = #" & Loopdate & "# AND personid = " & personid
starttime is a Date/Time field which contains a Date/Time (I know the name is a little misleading.) But for this update I want to disregard the time portion. If I use
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE Format(starttime,""mm/dd/yyyy"") = #" & Loopdate & "# AND personid = " & personid
it doesn't work. If I use
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE DateValue(starttime) = #" & Loopdate & "# AND personid = " & personid
it doesn't work. I'm sure the problem is with the date because
CurrentDb.Execute "UPDATE tblHoursworked SET weekno = " & weekno & " WHERE personid = " & personid
(where I'm leaving out the date check) performs an update but does it for all dates which is not what I need.
How can make this update query select based on the date part of field starttime?
Robert