Results 1 to 3 of 3

Thread: arghhhh

  1. #1
    Barry Guest

    Default arghhhh

    I am trying to put the date into an Access database using the folllowing insert statement:<BR><BR>timestamp=now()<BR><BR> sqlstmt = "UPDATE table1" <BR> sqlstmt = sqlstmt & " SET argo= &#039 1&#039,"<BR> sqlstmt = sqlstmt & "timestamp= timestamp "<BR> sqlstmt = sqlstmt & " WHERE ID="&ID<BR> Set rs = con.execute(sqlstmt) <BR><BR>I get no errors finally but there is nothing in the timestamp field either. If I response.write timein it show the date and the time perfectly. Timestamp in the database is set to General Date which appears to be the correct format.<BR><BR>Any ideas as to how to fix this would be appreciated.

  2. #2
    gh Guest

    Default RE: arghhhh

    You aren&#039t using the variable&#039s value, but are actually updating the timestamp column to itself. <BR><BR>Try something like this to concatenate the VALUE of timestamp into the sql statement, surrounded by pound signs. If they don&#039t work, try surrounding with single quotes (depends on the MDAC version you&#039re using which will work). Good luck.<BR><BR>sqlstmt = sqlstmt & "timestamp= #" & timestamp & "#"<BR><BR>BTW:<BR>Response.Write sqlstmt<BR>and try it out first in Access (outside of ASP) to save yourself some trouble..<BR> <BR> <BR>

  3. #3
    Barry Guest

    Default That did it! Thanks for the lesson!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts