"h3llz" <h3llz[ at ]discussions.microsoft.com> wrote in message news:BC7EEE20-A862-4C80-ACD2-F58F9042E6BD[ at ]microsoft.com...
[Quoted Text] > "UPDATE tblBaskets SET timestamp='" & Now() & "' WHERE basketID=" & > basketID > & ";" > > if i update the timestamp it gives a syntax error :< timestamp is > Date/Time > with general date
Use the # delimiter with date/time values:
"UPDATE tblBaskets SET timestamp=#" & _ Now() & "# WHERE basketID=" & basketID & ";"
Note, though, that the date will be interpreted as being in month/day/year format if that interpretation results in a valid date, even if you are accustomed to day/month/year format.
You should probably explicitly format the Now() value to avoid any ambiguity:
"UPDATE tblBaskets SET timestamp=#" & _ Format(Now(), "mm/dd/yyyy hh:nn:ss") & _ "# WHERE basketID=" & basketID & ";"
-- Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup)
|