SQL Update Query

W

Weste

My app has Access 2003 for the FE and SQL 2005 for the backend. I am trying
to run the following update query from Access.

"UPDATE tblSources SET ImportID = 1, LastUpdate = #" & Now() & "# WHERE ID =
1"

I get an error message regarding the LastUpdate field. It says error near
the 4 which is the hour from the Now() function. The code works file with an
MS Access BE but not with SQL server. Any help would be appreciated. Thanks.
 
R

Robert Morley

I've only ever used SQL Server in an ADP environment, but there are two
things that I can think of to try that might solve your problem:

Use single-quotes as a date delimiter instead of #'s.
Change the date format to SQL Server standard using Format(Now(), "mm/dd/yy
h:nn:ss am/pm") and see if that helps.


Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top