Crystal Report 2011 (Can SQL be used to return a value) see below
Posted on 2012-03-12
SELECT SUM (T2.Duration) as TOTAL FROM dbo.CallDetail AS T1, dbo.CallDetail AS T2
WHERE T1.InternalID = 'VIP' and T1.BaseID = T2.BaseID AND T2.Times > '2012-01-08'
AND T2.InternalNum >= 600 and T2.InternalNum < 700
GROUP BY T2.BaseID
ORDER BY T2.BaseID
This SQL statement above returns a SUM and is EXACTLY what I need to pull into my Crystal Report. I'm able to write the SQL but I don't know how to add this into Crystal.. Is there a way to add a SQL statement and then dump that into a row to return the sum?