ok then...do this... (use the query i sent you as a subquery...then collapse the columns) -- typing as i think
SELECT DataType,
MAX(CASE
WHEN DataType in ('CURRENCY','NUMBER') THEN CAST(MaxNumer as varchar)
WHEN DataType in ('Date') THEN CAST(MaxDate as varchar)
ELSE NULL END) as MaxFieldValue
FROM (
SELECT
DataType,
MAX(
CASE WHEN DataType in ('CURRENCY','NUMBER') THEN CAST(Value AS DECIMAL(18,2))
ELSE NULL END) AS MaxNumber,
MAX(
CASE WHEN DataType in ('Date') THEN CAST(Value AS Datetime)
ELSE NULL END) AS MaxDate,
FROM GetMaxValues
GROUP BY DataType
) T1
GROUP BY DataType
--------------------------------------------------------------------------
When you realize you've dug yourself into a hole....Step 1...stop digging.