Another SQL error

Results 1 to 2 of 2

Thread: Another SQL error

  1. #1
    Join Date
    Dec 1969

    Default Another SQL error

    I am not the best at SQL, and my reference books don&#039;t go super deep into SQL. Therefore, I am getting an error message after adding the "AND EventTitle..." line to the code snippet below:<BR>--------------------------------------------------<BR>sqlString = "Select orders.*, product_name " &_<BR> "from orders, products " &_<BR> "WHERE order_userid = " & user_id & " " &_<BR> "AND EventTitle &#060;&#062; " " " &_<BR> "ORDER BY order_entrydate DESC"<BR><BR>SET RS = Conn.Execute( sqlString )<BR>-------------------------------------------------<BR>The error message I am getting is:<BR>-------------------------------------------------<BR>Microsoft VBScript compilation error &#039;800a0401&#039; <BR><BR>Expected end of statement <BR><BR>/test/account.asp, line 41 <BR><BR>"AND EventTitle &#060;&#062; " " " &_<BR>---------------------^<BR>--------------------------------------------------<BR>I also get an error message when I remove the space between the 3rd and 4th " on that line. Can anyone tell me how to fix this statement. Basically, I am trying to get it to only populate the recordset with records that have a value for EventTitle

  2. #2
    Join Date
    Dec 1969

    Default RE: Another SQL error

    "AND EventTitle &#060;&#062; " " " &_<BR><BR>should be<BR><BR>"AND EventTitle IS NOT NULL " &_<BR><BR>There&#039;s decent SQL FAQ,tips & articles @

Posting Permissions

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