Urgent : SQL Server DateTime problem

Results 1 to 2 of 2

Thread: Urgent : SQL Server DateTime problem

  1. #1
    Join Date
    Dec 1969
    Posts
    723

    Default Urgent : SQL Server DateTime problem

    Hi<BR><BR>I use this to update my database :<BR><BR>strSql = "update forum set F_Last_Post = &#039" & now() & "&#039, F_Count = F_Count +1 where Forum_ID = " & Request.Form("forum_id")<BR> my_conn.Execute (StrSql)<BR><BR>F_Last_Post is datetime type with the value of now as the default in SQL server.<BR><BR>I get<BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.<BR>/forums/post_info.asp, line 388<BR><BR>what have I done wrong ?<BR><BR>thanks<BR>

  2. #2
    sathiya Guest

    Default RE: Urgent : SQL Server DateTime problem

    Remove the quotes on Now()<BR><BR>strSql = "update forum set F_Last_Post = &#039" & now() & "&#039, F_Count = F_Count +1 where Forum_ID = " & Request.Form("forum_id")<BR>my_conn.Execute (StrSql)<BR>-----<BR>NEW<BR>---<BR>strSql = "update forum set F_Last_Post = " & now() & ", F_Count = F_Count +1 where Forum_ID = " & Request.Form("forum_id")<BR>my_conn.Execute (StrSql)<BR><BR>this may help you<BR><BR>Sathiya

Posting Permissions

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