How to find a number exactly in string (1 Viewer)

btamsgn

Member
Local time
Today, 09:26
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

  • exactly.zip
    18.3 KB · Views: 144

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 10:26
Joined
May 7, 2009
Messages
19,249
Is this what you meant.
 

Attachments

  • exactly.zip
    18.2 KB · Views: 166

SHANEMAC51

Active member
Local time
Today, 05:26
Joined
Jan 28, 2022
Messages
310
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

Top Bottom