I need to SUM a range of records from a fixed DATE in the DB, the fixed date is 'A.relationship_from' and I have to SUM 90 days from that DATE
SELECT A.AGENT_CODE,T.AGENT_ID,Count (T.TRANS_ACTION_ID), Sum (T.amt_dls),A.relationship_from
FROM TRANSACTION_TABLE T,
AGENT A (NOLOCK)
WHERE T.agent_id = A.agent_id
AND t.DOT >= '2007-05-20'
AND promoter_region = 'SC'
AND promoter_center = '4'
--AND T.AGENT_ID = '460'
GROUP BY T.AGENT_ID,A.agent_CODE,A.relationship_from
ORDER BY T.AGENT_ID
----
This is a result but not from the date I would like :
TX-544 544 2 950.0000 2006-09-26 00:00:00.000