View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike NG Mike NG is offline
external usenet poster
 
Posts: 87
Default InStr used in SQL query

On Fri, 18 Jul 2003 at 02:50:55, dchow (dchow )
wrote:
WHERE (InStr(TaxID, ""PST"") < 0)

If I changed it to
WHERE (Right(TaxID, 3) = ""PST"")

Change your SQL to

WHERE TaxId LIKE '%PST%'

Well that's what standard SQL is anyway. If that doesn't work, then it
may be * instead of % - I say this because the Like keyword in an If
statements expects *
e.g. If TaxId like '*PST*' Then
--
Mike