I think you are using "record" to mean patient record. If you placed {table.patientID} and {field.testcode} on the report canvas and ran the report, I'm guessing you would have multiple records, one for each test code. If that is the case, then you could create a record select formula like:
{field.testcode} in ["Amy", "Lips", "SGOT", "SGPT"]
Then create four formulas for the details section:
{@Amy}:
if {field.testcode} = "Amy" then 1 else 0
{@Lips}:
if {field.testcode} = "Lips" then 1 else 0
{@SGOT}:
if {field.testcode} = "SGOT" then 1 else 0
{@SGPT}:
if {field.testcode} = "SGPT" then 1 else 0
Group on {table.patientID} and then go to report->edit selection formula->GROUP and enter:
sum({@Amy},{table.patientID}) > 0 and
sum({@Lips},{table.patientID}) > 0 and
sum({@SGOT},{table.patientID}) > 0 and
sum({@SGPT},{table.patientID}) > 0
This will return only those patients (and their associated details) who have had all four tests.
-LB