what part of this sql is not working

Results 1 to 4 of 4

Thread: what part of this sql is not working

  1. #1
    bails Guest

    Default what part of this sql is not working

    I have a login user id and password set at Session_OnStart and I&#039m trying to set that to the updated_by field using the sql statement below.<BR>How do I call the Session id and use it in my sql statement?<BR>Thx in advance for any help.<BR><BR>sql = "UPDATE JOBS"<BR>sql = sql & " SET remarks=&#039"&remarks&"&#039,last_update=Now,upda ted_by =Session("login_id")"<BR>

  2. #2
    Hugo Mejia Guest

    Default RE: what part of this sql is not working

    Try This:<BR>if connected to a SQL Server database <BR>sql="Update Jobs Set " & _<BR> "Remarks= &#039" & remarks & "&#039," & _<BR> "last_update= &#039" & Now & "&#039," & _<BR> "updated_by=&#039" & session("login_id") & "&#039"<BR><BR>if connected to an Access database<BR>sql="Update Jobs Set " & _<BR> "Remarks= &#039" & remarks & "&#039," & _<BR> "last_update= #" & Now & "#," & _<BR> "updated_by=&#039" & session("login_id") & "&#039"<BR><BR>There a good chance that that will work.<BR>

  3. #3
    bails Guest

    Default RE: what part of this sql is not working

    Thx Hugo for you reply, but it still is not working what I&#039m really trying to do is pass the current session variable to updated_by. thx again for your help.

  4. #4
    Jairo Guest

    Default RE: what part of this sql is not working

    Assuming you&#039re using SQL Server, try this:<BR><BR>sql = "UPDATE JOBS"<BR>sql = sql & " SET remarks=&#039" & remarks & "&#039, "<BR>sql = sql & " last_update=getdate(), "<BR>sql = sql & "updated_by = &#039" & Session("login_id") & "&#039 "<BR><BR>HTH,<BR>Jairo<BR>


Posting Permissions

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