Question : How to use wildcards with multipple selection criteria.

I have a need to find rows where the account number can not only be the exact account number, some variation.  The account number has six characters, but there can be variaitions in that other characters can appear before the 6-digest or after  That is, it could not be BIG123456 as well as 123456Small.  I have 30 "base" account numbers that I need to loop throught to find all variations of each account, but from what I see SQL T-SQL does not allow For loops or arrays so I am wondering how to approach this need.  Rigth now I have the attached, which does not return the variations.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
CREATE TABLE #returndata
(appl_report_id varchar(32) NOT NULL
 ,rpt_id INT NOT NULL
 , job_id INT NOT NULL
 , job_mne_cd varchar (60) NOT NULL
 , job_nm varchar(60) NOT NULL
 , rpt_typ_id INT NOT NULL
 , rpt_typ_nm varchar(50) NOT NULL
 , rpt_nm varchar (60) NOT NULL
 , person_id INT
 , legal_entity_id INT
 , recipient varchar(60) NOT NULL
 , company_nm varchar(100) NOT NULL
 , email_address varchar(60) NOT NULL
 , phone_nm varchar(35) NOT NULL
 , fax_nm varchar(35) NOT NULL
 , address_id INT
 , company_address varchar(250) NOT NULL
 , delivery_mthd_cd varchar(1) NOT NULL
 , delivery_mthd varchar(25) NOT NULL )

INSERT #returndata
SELECT appl_report_id --appl_report_id varchar(8) NOT NULL
    ,rpt_id   --rpt_id INT NOT NULL
    , job_id    --job_id INT NOT NULL
    , 'Unknown' --job_mne_cd varchar (60) NOT NULL
    , 'Unknown' --job_nm varchar(60) NOT NULL
    , rpt_typ_id--rpt_typ_id INT NOT NULL
    , 'Tracking'-- varchar(50) NOT NULL
    , rpt_nm    --rpt_nm varchar (60) NOT NULL
    , 0         --person_id INT
    , 0         --legal_entity_id INT
    , 'Unknown' --recipient varchar(60) NOT NULL
    , 'Unknown' --company_nm varchar(60) NOT NULL
    , 'Unknown' --email_address varchar(60) NOT NULL
    , 'Unknown' --phone_nm varchar(35) NOT NULL
    , 'Unknown' --fax_nm varchard(35) NOT NULL
    , 0         --address_id INT
    , 'Unknown' --company_address varchar(100) NOT NULL
    , 'A'       --delivery_mthd_cd varchar(1) NOT NULL
    , 'Unknown' --delivery_mthd varchar(25) NOT NULL
FROM crs_db.dbo.t_rpt
WHERE rpt_typ_id = 102 AND
    appl_report_id IN('510577','608970','622419','619860','567908','536382','553742', '536051','640364','582691','576990','578293','540046','610985','666229','613857','588615','577139','629519','537455','200155','200154','104606','107472','105874','200264','200415','200541','671124','200475')

Answer : How to use wildcards with multipple selection criteria.

Change the where clause to

WHERE rpt_typ_id = 102 AND
(appl_report_id LIKE '%510577%' or appl_report_id LIKE '%608970%' or appl_report_id LIKE '%622419%' or appl_report_id LIKE '%619860%' or appl_report_id LIKE '%567908%' or appl_report_id LIKE '%536382%' or appl_report_id LIKE '%553742%' or appl_report_id LIKE '%536051%' or appl_report_id LIKE '%640364%' or appl_report_id LIKE '%582691%' or appl_report_id LIKE '%576990%' or appl_report_id LIKE '%578293%' or appl_report_id LIKE '%540046%' or appl_report_id LIKE '%610985%' or appl_report_id LIKE '%666229%' or appl_report_id LIKE '%613857%' or appl_report_id LIKE '%588615%' or appl_report_id LIKE '%577139%' or appl_report_id LIKE '%629519%' or appl_report_id LIKE '%537455%' or appl_report_id LIKE '%200155%' or appl_report_id LIKE '%200154%' or appl_report_id LIKE '%104606%' or appl_report_id LIKE '%107472%' or appl_report_id LIKE '%105874%' or appl_report_id LIKE '%200264%' or appl_report_id LIKE '%200415%' or appl_report_id LIKE '%200541%' or appl_report_id LIKE '%671124%' or appl_report_id LIKE '%200475%')
Random Solutions  
 
programming4us programming4us