"David" wrote ...
If I have a recordset value in RS("ProductName"), is it possible to
test for a part string in this value ?
yes
can this only be done within the select statement ?
If you want to do this within the ASP and not the select statement, you can
use InStr.
InStr will return a numeric value for the character location of the first
found match.
So -
strText = "blue.pants"
Location = InStr(strText, "blue")
In this case, InStr would return as 1 - the first character in the string
etc...
You would need to put this in the loop for your recordset.
Do While Not RS.BOF And Not RS.EOF
strText = RS("text")
Location = InStr(strText, "blue")
If InStr > 0 Then
' do something
End If
RS.MoveNext
Loop
You might also want to put LCase() around strText within the InStr line
above - then you can be sure it wont be case sensitive etc when matching...
To be honest, depending on your needs, it might be a lot quicker to just
change your SQL statement to return all the records you want where it
already contains "blue" in the relevant field etc...
Hope this helps,
Regards
Rob