A sample image of this SQL report run in the Database Viewer is shown below:
In the third line, 'ABC%' must be changed to properly run this code. You can do one of the following:
- Change the letters ‘ABC%’ to look for your desired insurance policy prefix. For example, if you are looking for all patients whose insurance policy number begins with WT3, change the third line to:
where INSURED_ID like 'WT3%'
- If you are looking for a sequence of letters or characters that appear anywhere in the insurance policy (not just at the beginning [prefix]), add a % sign to the beginning of the alphanumeric sequence. For example, if you are looking for patients whose insurance policy includes the sequence 156 anywhere in the policy number, change the third line to:
where INSURED_ID like '%156%'
To highlight and copy the code below to your clipboard, simply click the Copy button.
select PATNO,fname,lname,INS_CARRIER_NAME,insured1.INSURED_ID from insured1 inner join register on register.patno = insured1.patno where insured1.INSURED_ID like 'ABC%' and status_policy ='ACTIVE' and status_pat = 'ACTIVE'