Problem with query and date
I'm trying to only show particular results in my query based on the following:
If the "agreedate" is greater than today's date, minus 60 days, show it. Otherwise I don't want the results showing.
I am still getting results showing from last year and I don't know why.
Here is my code:
<!---set todays date minus 60 days. This is working and shows the correct date--->
<cfset invitelimit = #now()#>
<cfset invitelimit = #DateFormat(DateAdd('d', -60, invitelimit),'mm-dd-yyyy')#
<!---query the items from the db and try to only grab the ones with an agreedate greater then the invitelimit date--->
<cfquery name="qinvite" datasource="#Application.ds#">
SELECT DISTINCT * FROM team a
INNER JOIN teammembers b ON a.id = b.team_id
INNER JOIN termsagreement c ON a.login = c.login
WHERE c.agreedate > #invitelimit# AND b.comp_id = 0
Group By a.teamname
</cfquery>