This is the code for the page as it is now working
<!--- This page will display the listing of all equipment based on the selections made. --->
<cfinclude template="../Common/INV_header.cfm">
</td>
</tr>
<!--Main body of module --->
<!--- This converts the date string to date/time format for the table. --->
<CFIF #Form.DateQueried# NEQ "">
<CFSET DateQueried = #LSParseDateTime(Form.DateQueried)#>
</CFIF>
<CFIF #Form.SerialNumber# EQ "">
<CFIF #Form.Item_Type# NEQ "ALL">
<CFIF #Form.OfficeSymbol# IS "">
<!--- Lookup was done using Directorate Symbol. --->
<CFIF #Form.Item_Type# IS "ADP">
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (ADP = 1) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.AssetID# EQ "">
AND AssetID = '#Form.AssetID#'
</cfif>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSEIF #Form.Item_Type# IS "NON-ADP">
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (ADP = 0) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
<CFELSEIF #Form.OfficeSymbol# NEQ "">
<!---Lookup was done using Office Symbol.--->
<CFIF #Form.Item_Type# IS "ADP">
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (ADP = 1) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSEIF #Form.Item_Type# IS "NON-ADP">
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (ADP = 0) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
</CFIF>
<CFELSE>
<!---If user wants to display ALL equipment--->
<CFIF #Form.OfficeSymbol# NEQ "">
<!---Lookup was done using Office Symbol.--->
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (MarkforDeletion = 0) AND (Directorate = '#Session.Directorate#')
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</CFIF>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSE>
<!-- Lookup was done using Directorate Symbol. --->
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ "">
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ "1">
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ "0">
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ "">
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ "">
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ "">
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
</CFIF>
<CFELSE>
<!--- Lookup was done using Serial Number. --->
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (SerialNumber = '#Form.SerialNumber#') AND (MarkforDeletion = 0)
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
AND (Directorate = '#Session.Directorate#')
ORDER BY OfficeSymbol
</cfquery>
</cfif>
<cfoutput>
<CFIF #List_records.RecordCount# GT 0>
<!--Records found --->
<CFIF #Form.DateQueried# NEQ "">
<CFSET client.lastqueried = #DateQueried#>
</CFIF>
<table width=80% border="0" cellspacing="1" cellpadding="2" align="center">
<tr><h4>Equipment Inventory</h4><h6>Click on Record Number to see details of record.<br> To print, click on File, Print from browser.<BR>Ensure you change your printer settings: orientation to landscape and paper size to legal size.</h6></tr>
<tr bgcolor="#TitleColor1#">
<th>Record No.</th>
<th>Asset ID</th>
<th>BarCode</th>
<th>Manuf Make</th>
<th>Manuf Model</th>
<th width= "100">S/N</th>
<th width="70">Nomenclature</th>
<th>Office Symbol</th>
<th>Unit Price</th>
<th>User ID</th>
<th>Equip Status</th>
<th>ADP</th>
</tr>
<cfform action="" method="POST" enablecab="Yes">
<cfloop query="List_records">
<tr bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('c0c0c0'))#">
<td align="center"><a href="Record_Change.cfm?RecordID=#List_records.ID#" onMouseover="window.status='CNRC Inventory Website';return true" >#List_records.ID#</a></td>
<td align="center">#List_records.AssetID#</td>
<td align="center">#List_records.BarCode#</td>
<td align="center">#List_records.ManufacturerMake#</td>
<td align="center">#List_records.ManufacturerModel#</td>
<td align="center">#List_records.SerialNumber#</td>
<td align="center">#List_records.Nomenclature#</td>
<td align="center">#List_records.OfficeSymbol#</td>
<td align="center">#DollarFormat(List_records.UnitPrice)#</td>
<td align="center">#List_records.UserID#</td>
<td align="center">#List_records.EquipmentStatus#</td>
<td align="center">#YesNoFormat(List_Records.ADP)#</td>
</tr>
</cfloop>
</cfform>
<tr>
<b>Total Number of Records: #List_records.RecordCount#</b>
</tr>
<CFELSEIF #List_Records.RecordCount# IS 0>
<!---No records found. --->
<script language="JavaScript">
<!-- Hide from Java-challenged browsers
history.back();
alert('No records found. Please correct and resubmit.');
-->
</script>
No records found. Please correct and resubmit.
<CFSET RecordID = "">
CFABORT
</CFIF>
</cfoutput>
</table>
<cfinclude template="../Common/footer.cfm">
= = = = = = =
This is the code I'm trying to insert for an additional selection:
<CFIF>
<!--- Lookup was done using Bar Code. --->
<cfquery name="List_records" datasource="INV2" dbtype="ODBC">
SELECT *
FROM Assets
WHERE (BarCode = '#Form.BarCode#')
</cfquery>
</cfif>
Any assistance you can provide will be greatly appreciated. I've been placing this code in various locations for several days, with no success.