I have 2 tables. The first table (Drug) contains the following columns; Index, Name, Type. The second table (dreeval) contains CNS_Depr_list, CNS_Stim_list, Hallucinogens_list, PCP_list, NA_list, Inhalants_list, and Cannabis_list. The values in the fields above can contain one drug name or multiple drug names in a comma delimited list. (ie. Amphetamine,Cocaine,Methamphetamine). <br>I query the drug table for a list of all drugs, the I use those drug names to check the columns in the dreeval table for matches using the following code:<br><br><cfquery name="GetDepr" datasource="dre_new" dbtype="ODBC"><br> Select *<br> from drug<br> Order by Type<br></cfquery><br><br><cfloop query="GetDepr"><br><cfset drugname = '#GetDepr.Name#'><br><cfquery name="GetDrugNum" datasource="dre_new" dbtype="ODBC"><br> Select conf_CNS_Depr_list<br> from dreeval<br> where conf_CNS_Depr_list = '#Variables.drugname#'<br></cfquery><br></cfloop><br><br><table><br><cfoutput query="GetDepr" group="Type"><br><tr><td colspan="2"><b><div align="center">#GetDepr.Type#</div></b></td></tr><br><cfoutput><tr><td>#GetDepr.Name#td><td>#GetDrugNum.RecordCount#</td></tr> </cfoutput></cfoutput><br></table><br><br>I am doing somthing wrong in the output because it is only outputing the RecordCount for the first variable.drugname. What am I doing wrong here?<br>TIA,<br>Kim