       <cfset basQual = " #basQual# AND to_meters(tbl_axillary_girth.attribute_value,tbl_axillary_girth.attribute_units) #oper# to_meters(#schTerm#,'#schunits#')">
     <cfelse>
       <cfset basQual = " #basQual# AND tbl_axillary_girth.attribute_value #oper# '#schTerm#'">
+    </cfif>
+  </cfif>
+</cfif>
+
+<cfif isdefined("bill_depth") and len(bill_depth) gt 0>
+  <cfset mapurl = "#mapurl#&bill_depth=#bill_depth#">
+  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_bill_depth ON (#session.flatTableName#.collection_object_id = tbl_bill_depth.collection_object_id)">
+  <cfset basQual = " #basQual# AND tbl_bill_depth.attribute_type = 'bill depth'">
+  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_bill_depth.is_encumbered = 0"></cfif>
+  <cfif bill_depth neq "_">
+    <cfset schunits="">
+    <cfset oper=left(bill_depth,1)>
+    <cfif listfind(numattrschops,oper)>
+      <cfset schTerm=ucase(right(bill_depth,len(bill_depth)-1))>
+    <cfelse>
+      <cfset oper="like"><cfset schTerm=ucase(bill_depth)>
+    </cfif>
+    <cfif oper is "!"><cfset oper="!="></cfif>
+    <cfset temp=trim(rereplace(schTerm,"[0-9]","","all"))>
+    <cfif len(temp) gt 0 and listfindnocase(attrLengthUnits,temp) and isnumeric(replace(schTerm,temp,""))>
+      <cfset schTerm=replace(schTerm,temp,"")><cfset schunits=temp>
+    <cfelseif left(temp,1) eq "-" and listfindnocase(attrTimeUnits,trim(replace(temp,"-","")))>
+      <cfset schunits=trim(replace(temp,"-",""))>
+      <cfset low=trim(listgetat(numeric_age,1,"-"))>
+      <cfset high=trim(replacenocase(replace(replace(numeric_age,low,"","first"),"-",""),schunits,""))>
+      <cfset schTerm=trim(replace(replace(replace(numeric_age,schunits,""),low,""),high,""))>
+      <cfif len(low) gt 0 and len(high) gt 0 and len(schunits) gt 0><cfset oper="between"></cfif>
+    </cfif>
+    <cfif oper is "between">
+      <cfset basQual = " #basQual# AND to_days(tbl_bill_depth.attribute_value,tbl_bill_depth.attribute_units) #oper# to_days(#low#,'#schunits#') and to_days(#high#,'#schunits#')">
+    <cfelseif len(schunits) gt 0>
+      <cfset basQual = " #basQual# AND to_meters(tbl_bill_depth.attribute_value,tbl_bill_depth.attribute_units) #oper# to_meters(#schTerm#,'#schunits#')">
+    <cfelse>
+      <cfset basQual = " #basQual# AND tbl_bill_depth.attribute_value #oper# '#schTerm#'">
+    </cfif>
+  </cfif>
+</cfif>
+
+<cfif isdefined("bill_width") and len(bill_width) gt 0>
+  <cfset mapurl = "#mapurl#&bill_width=#bill_width#">
+  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_bill_width ON (#session.flatTableName#.collection_object_id = tbl_bill_width.collection_object_id)">
+  <cfset basQual = " #basQual# AND tbl_bill_width.attribute_type = 'bill width'">
+  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_bill_width.is_encumbered = 0"></cfif>
+  <cfif bill_width neq "_">
+    <cfset schunits="">
+    <cfset oper=left(bill_width,1)>
+    <cfif listfind(numattrschops,oper)>
+      <cfset schTerm=ucase(right(bill_width,len(bill_width)-1))>
+    <cfelse>
+      <cfset oper="like"><cfset schTerm=ucase(bill_width)>
+    </cfif>
+    <cfif oper is "!"><cfset oper="!="></cfif>
+    <cfset temp=trim(rereplace(schTerm,"[0-9]","","all"))>
+    <cfif len(temp) gt 0 and listfindnocase(attrLengthUnits,temp) and isnumeric(replace(schTerm,temp,""))>
+      <cfset schTerm=replace(schTerm,temp,"")><cfset schunits=temp>
+    <cfelseif left(temp,1) eq "-" and listfindnocase(attrTimeUnits,trim(replace(temp,"-","")))>
+      <cfset schunits=trim(replace(temp,"-",""))>
+      <cfset low=trim(listgetat(numeric_age,1,"-"))>
+      <cfset high=trim(replacenocase(replace(replace(numeric_age,low,"","first"),"-",""),schunits,""))>
+      <cfset schTerm=trim(replace(replace(replace(numeric_age,schunits,""),low,""),high,""))>
+      <cfif len(low) gt 0 and len(high) gt 0 and len(schunits) gt 0><cfset oper="between"></cfif>
+    </cfif>
+    <cfif oper is "between">
+      <cfset basQual = " #basQual# AND to_days(tbl_bill_width.attribute_value,tbl_bill_width.attribute_units) #oper# to_days(#low#,'#schunits#') and to_days(#high#,'#schunits#')">
+    <cfelseif len(schunits) gt 0>
+      <cfset basQual = " #basQual# AND to_meters(tbl_bill_width.attribute_value,tbl_bill_width.attribute_units) #oper# to_meters(#schTerm#,'#schunits#')">
+    <cfelse>
+      <cfset basQual = " #basQual# AND tbl_bill_width.attribute_value #oper# '#schTerm#'">
     </cfif>
   </cfif>
 </cfif>

  </cfif>
</cfif>

<cfif isdefined("purchase_value") and len(purchase_value) gt 0>
  <cfset mapurl = "#mapurl#&purchase_value=#purchase_value#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_purchase_value ON (#session.flatTableName#.collection_object_id = tbl_purchase_value.collection_object_id)">
  <cfset basQual = " #basQual# AND tbl_purchase_value.attribute_type = 'purchase value'">
  <cfif session.flatTableName is not "flat"><cfset basQual = " #basQual# AND tbl_purchase_value.is_encumbered = 0"></cfif>
  <cfif purchase_value neq "_">
    <cfset schunits="">
    <cfset oper=left(purchase_value,1)>
    <cfif listfind(numattrschops,oper)>
      <cfset schTerm=ucase(right(purchase_value,len(purchase_value)-1))>
    <cfelse>
      <cfset oper="like"><cfset schTerm=ucase(purchase_value)>
    </cfif>
    <cfif oper is "!"><cfset oper="!="></cfif>
    <cfset temp=trim(rereplace(schTerm,"[0-9]","","all"))>
    <cfif len(temp) gt 0 and listfindnocase('XXXX',temp) and isnumeric(replace(schTerm,temp,""))>
      <cfset schTerm=replace(schTerm,temp,"")><cfset schunits=temp>
    <cfelseif left(temp,1) eq "-" and listfindnocase(attrTimeUnits,trim(replace(temp,"-","")))>
      <cfset schunits=trim(replace(temp,"-",""))>
      <cfset low=trim(listgetat(numeric_age,1,"-"))>
      <cfset high=trim(replacenocase(replace(replace(numeric_age,low,"","first"),"-",""),schunits,""))>
      <cfset schTerm=trim(replace(replace(replace(numeric_age,schunits,""),low,""),high,""))>
      <cfif len(low) gt 0 and len(high) gt 0 and len(schunits) gt 0><cfset oper="between"></cfif>
    </cfif>
    <cfif len(schunits) gt 0>
      <cfset basQual = " #basQual# AND tbl_purchase_value.attribute_value #oper# #schTerm# and tbl_purchase_value.attribute_units='#schunits#' ">
    <cfelse>
      <cfset basQual = " #basQual# AND tbl_purchase_value.attribute_value #oper# '#schTerm#'">
    </cfif>
  </cfif>
</cfif>


  </cfif>
</cfif>

<cfif isdefined("wing_chord") and len(wing_chord) gt 0>
  <cfset mapurl = "#mapurl#&wing_chord=#wing_chord#">
  <cfset basJoin = " #basJoin# INNER JOIN v_attributes tbl_wing_chord ON (#session.flatTableName#.collection_object_id = tbl_wing_chord.collection_object_id)">
