var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Using Like or Wildcard
I am searching against a sql database and I want to return all active courses and all courses whose field code begins with a 10. This is the table (LEDef) & some of the info that is in the field.
I want to return only the "10-" stuff. Here is part of the code I'm using in 2 of my files. I've tried everything but nothing seems to work:
r.open "SELECT LEDef_PK FROM LEDef WHERE LEDef_ActiveInd = 1 AND LEDef_Cd LIKE '10-%'"
r.Open "SELECT LEDef_Cd, LEDef_Name, LEDef_Desc, LEDef_ActiveInd, FROM LEDef WHERE LEDef_ActiveInd = 1 and LEDef_Cd LIKE '10-%'"and LEDef_PK = " & Request.QueryString("id"),
Re: Using Like or Wildcard
have you tried enclosing - charactrer in brackets? e.g. LIKE '10[-]%'
A question regarding exactly what you are looking for, because what you described in your question seems different than whats in your query.
This is saying the record must have LEDef_ActiveInd = 1 or LEDef_Cd LIKE '10-%', either one of these will satisfy the conditions for your result set.
[i]I want to return all active courses and all courses whose field code begins with a 10
What you have coded says a record must have both LEDef_ActiveInd = 1 and LEDef_Cd LIKE '10-%' to be included. Having one or the other is not enough.
If you want either condition to be enough try
SELECT LEDef_PK FROM LEDef WHERE LEDef_ActiveInd = 1 OR LEDef_Cd LIKE '10-%'