Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.RunSQL using Now()

Status
Not open for further replies.

striker73

MIS
Jun 7, 2001
376
US
I am trying to run the following code:

DoCmd.RunSQL "Update mytable SET TimeVariable = #" & Now() & "#"

...however, sometimes it seems to work and sometimes it doesn't. Is there any quick fix? I'm guessing that it needs the date in # signs, but not the time. This line is part of a more complex function and I'd rather not have to declare a recordset and update the table that way. Any ideas? Thanks!
 
I got it to work like this:

docmd.runsql "UPDATE Agent SET Thedate = #" & now & "#" Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top