How to find a number exactly in string

btamsgn

Member
Local time
Today, 15:16
Joined
Nov 8, 2010
Messages
51
Dear Everyone,

I want to find a number exactly in string
ex. string field ="2,3,17,25,46"
C1 field=5 => result "no find" instead of 9
C2 field=1 => result "no find" instead of 5
etc.
Pls find the attachment for your ref., Thanks.
 

Attachments

Is this what you meant.
I would probably reduce the number of quotes by simplifying the expression
Code:
SELECT ",2,4,7,16,27,35," AS Chuoi,
 IIf(InStr([Chuoi],"," & Val([C1]) & ",") >0,[C1],Null) AS A1,
 IIf(InStr([Chuoi],"," & Val([C2]) & ",") >0,[C2],Null) AS A2,
 IIf(InStr([Chuoi],"," & Val([C3]) & ",") >0,[C3],Null) AS A3,
 Sso.C1, Sso.C2, Sso.C3
FROM Sso;
 

Users who are viewing this thread

Back
Top Bottom