Report of contracts to expire in the next 90 days

Report of contracts to expire in the next 90 days

Currently I have this report for my postgres db but it only give me contracts expiring this quarter. I need the same report but for the next 90 days.

Thanks.

SELECT ad.ORG_NAME "Account", CUSTOMCONTRACTID "# Contrato", cst.STATUSNAME "Estado",longtodate(mcdt.FROMDATE) "From Date",longtodate(mcdt.TODATE) "To Date" FROM MaintenanceContract mcdt inner JOIN Contract_Fields cadf ON mcdt.CONTRACTID=cadf.CONTRACTID inner JOIN VendorDefinition vdn ON mcdt.MAINTENANCEVENDOR=vdn.VENDORID inner JOIN SDOrganization aao ON vdn.VENDORID=aao.ORG_ID inner JOIN SDUser cby ON mcdt.CREATEDBY=cby.USERID inner JOIN AaaUser cbyaau ON cby.USERID=cbyaau.USER_ID inner JOIN ContractStatus cst ON mcdt.STATUSID=cst.STATUSID 
INNER JOIN ContractAccountmapping camp ON mcdt.contractid=camp.contractid INNER JOIN AccountDefinition ad ON camp.accountid=ad.org_id INNER JOIN ContractAccountMapping ON mcdt.CONTRACTID=ContractAccountMapping.CONTRACTID
WHERE   (mcdt.TODATE >=  <from_thisquarter>
AND 
mcdt.TODATE <=  <to_thisquarter>   )
AND customcontractid is not null

ORDER BY mcdt.TODATE
                New to ADManager Plus?

                  New to ADSelfService Plus?