When looking at the HQMS_Results, HQMS_serialLotAttributes and other tables that store the Value field that users enter in results into you need to do a bit of a conversion process.
This field holds values for numbers but it also holds links to other results tables to translate the system code numbers into text or date fields.
As a general rule anytime you see a field that ends with SID it means you need to look to the HQMS_SysCodes table for a value. If the field ends with ID then you look at the primary key in the table that the field references.
Here is an example of the query to do the translations using the HQMS_SerialLotAttributes table. The system code IDs will never change so you can use these values hard coded in your queries.
SELECT SerialLotNumber, ItemID, Value,
CASE DataTypeSID
WHEN 2001 THEN CAST(Value AS nVARCHAR(10))
WHEN 2002 THEN CASE Value WHEN 1 THEN 'True' ELSE 'FALSE' END
WHEN 2004 THEN (SELECT SysCodeDesc FROM HQMS_SysCodes WHERE SysCodesID = a.Value)
WHEN 2005 THEN (SELECT Description FROM HQMS_ResultsText WHERE ResultsTextID = a.Value)
WHEN 2006 THEN (SELECT CAST(CAST(RecordedDateTime as date) as varchar(100)) FROM HQMS_ResultsDate WHERE ResultsDateID = a.Value)
WHEN 2007 THEN (SELECT CAST(CAST(RecordedDateTime as time) AS nvarchar(100)) FROM HQMS_ResultsDate WHERE ResultsDateID = a.Value)
WHEN 2008 THEN (SELECT CAST(CAST(RecordedDateTime as datetime) AS nvarchar(100)) FROM HQMS_ResultsDate WHERE ResultsDateID = a.Value)
WHEN 2009 THEN (SELECT Description FROM HQMS_ResultsText WHERE ResultsTextID = a.Value)
END AS DerivedValue
FROM HQMS_SerialLotAttrib AS a