Problem with the 'where clause' in the sel

Results 1 to 3 of 3

Thread: Problem with the 'where clause' in the sel

  1. #1
    Sumithra Sudhir Guest

    Default Problem with the 'where clause' in the sel

    sqlClipdisp="SELECT ClipDescription,ClipLibrary,ClipName FROM ClipInfo where ClipInfo.ClipName = &#039" & Cname & "&#039 and ClipInfo.ViewerAge = & CAge and ClipInfo.ViewerRace = " & CRace<BR><BR>CAge and CRace are integers.<BR><BR>The above statement gives an error<BR>"Incorrect syntax near "<BR><BR>The variable CAge(any variable for that matter) has a valid value in it , but still the SQL statement does not get substituted with the CAge(any variable for that matter). Is there<BR>a different way to give two "and" in the where clause of a select statement in ASP.<BR><BR>ANy help is appreciated.<BR><BR>Thanks<BR>

  2. #2
    Jason Miller Guest

    Default a minor re-write

    Try this...<BR><BR>sqlClipdisp = "SELECT ClipDescription, ClipLibrary, ClipName FROM ClipInfo where ClipName = &#039" & Cname & "&#039 and ViewerAge = " & cInt(CAge) & " and ViewerRace = " & cInt(CRace) & ";"

  3. #3
    Thanks Jason Miller Guest

    Default RE: a minor re-write

    It works. <BR>Thanks a lot. It was a great relief...<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