Simple SQL Problem

Results 1 to 2 of 2

Thread: Simple SQL Problem

  1. #1
    Join Date
    Dec 1969

    Default Simple SQL Problem

    Hi,<BR> Here&#039s my SQL<BR>ObjRS.Open "Select * from State Where ID In(1,2) and StateName Like &#039"%LL%"&#039", objRS, adOpenKeyset, adLockOptimistic, adCmdText<BR><BR>For this I am getting the following error..<BR><BR>Microsoft VBScript compilation error &#039 800a0408&#039 <BR>Invalid character <BR>/Project2/WizardState.asp, line 173 <BR>and it is pointing out to the "%" character..<BR>can any one help me in this<BR><BR>Regards,<BR>Sam<BR><BR><BR>

  2. #2
    Jason Guest

    Default RE: Simple SQL Problem

    if you are setting the wildcard to be always LL, you can rewrite your sql statement like this - <BR>"Select * from State Where ID In(1,2) and StateName Like &#039%LL%&#039", <BR><BR>You need to remove the extra speech marks around the % symbols. Also, if you know the field names, it is better to use those and than a * - there is a reason, just can&#039t think of it :)<BR><BR>Good luck.<BR><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