Sort by returning ID of Lookup Field not Value

Sort by returning ID of Lookup Field not Value

Hello,

We have a static HTML page (stateless form) that is a report pulling data from multiple forms.

a search value is passed from another form to this HTML page. 

Then we have a variable asset which looks like this:

 asset  =  Add_Edit_Assets  [Assets_Account_Lookup == search.ID] sort by  Assets_Type_Lookup ;

Later in the page we have a "For Each" that looks like this:

  1. <%for each x in asset
  2.         {
  3.             type  =  Default_Device_Types  [ID == x.Assets_Type_Lookup];
  4.             manu  =  Default_Manufacturers  [ID == x.Assets_Manufacturer_Lookup];
  5.             os  =  Operating_Systems  [ID == x.Assets_OS_Lookup];
  6.             proc  =  Processor_Types  [ID == x.Processor_Types];%>
  7. <tr class="zc-viewrow zc-row-1">
  8.   <td><%=x.Asset_Name%></td>
  9.                         <td><%=type.List_Asset_Type%></td>
  10.                         <td><%=x.Deployment_Date%></td>
  11.                         <td><%=x.Warranty_Expiration%></td>
  12.                         <td><%=x.Serial_Number%></td>
  13. <td><%=manu.List_Manufacturer%></td>
  14.                         <td><%=x.Model%></td>
  15.                         <td><%=os.Operating_System%></td>
  16.                         <td><%=x.RAM%></td>
  17.                         <td><%=proc.Processor_Type%></td>
  18. </tr>
The "sort by" in the "asset" variable works fine with one exception, it is sorting by the ID of "Assets_Type_Lookup" not the actual asset type "name" that the ID is associated with.

So everything is being grouped and sort but not in alphabetical order but in ID order. This wouldn't be a problem if all of the device types were entered alphabetically but we add device types all of the time so the IDs are no longer in alphabetical order.

How can I get the assets to sort by the value and not the ID?

Bryan