wellsuited
asked on
ASP If then using like
Please see my code below. I cannot get the LIKE clause to work with this if then statement. What am I doing wrong?
Thanks
Thanks
If (rstimes.Fields.Item("Prodoption").Value) LIKE "Triple%" Then
varused = 3
end if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just a minor correction to the previous workaround (no points please):
If Instr(1, rstimes.Fields.Item("Prodo ption").Va lue,"Tripl e", vbTextCompare) = 1 Then
varused = 3
End If
You should also be able to use RegEx for the same result.
If Instr(1, rstimes.Fields.Item("Prodo
varused = 3
End If
You should also be able to use RegEx for the same result.
Thanks acperkins, I always forget that detail.
That is because the Visual Basic Like operator is not supported in VBScript. See here for a complete list of the differences between Visual Basic and VbScript:
http://msdn.microsoft.com/en-us/library/30593abb(VS.85).aspx