• Slightly modified Dwain code to return exactly what OP has asked:

    DECLARE @t TABLE (strcol CHAR(3));

    DECLARE @ValueOfInterest INT = 10;

    INSERT INTO @t (strcol)

    SELECT ' 5' UNION ALL SELECT ' 6' UNION ALL SELECT ' 3'

    UNION ALL SELECT ' 4' UNION ALL SELECT ' 3';

    -- Improved Combinations

    ;WITH UNIQUEnTuples (n, Tuples, ID, CSum) AS (

    SELECT DISTINCT 1, CAST(strcol AS VARCHAR(8000)), strcol, CAST(strcol AS INT)

    FROM @t

    UNION ALL

    SELECT 1 + n.n, t.strcol + ',' + n.Tuples, strcol, CSum+CAST(t.strcol AS INT)

    FROM UNIQUEnTuples n

    CROSS APPLY (

    SELECT strcol

    FROM @t t

    WHERE t.strcol < n.ID) t

    )

    SELECT DISTINCT Tuples, SumOfTuples=CSum

    FROM UNIQUEnTuples

    WHERE n <= 2 AND CSum = (SELECT MAX(CSum) MS

    FROM UNIQUEnTuples

    WHERE n <= 2 AND CSum < @ValueOfInterest)

    ORDER BY CSum DESC;

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]