I have no idea what is wrong with this...it was working yesterday and this morning and I don't remember making any changes to any of my queries this morning. The only thing I did was change some background colors on some of the pages but I can't imagine that did anything. But it doesn't matter what I do, this query doesn't work any more and I get the error "Invalid parameter 1 specified for dateadd."
What is wrong with this query??????
<cfquery datasource="mydatasource" name="getMyCompletedCases">
FROM tbl_casemain MAN LEFT JOIN tbl_caseseverity SEV ON SEV.intCaseSevID = MAN.intCaseSevID
INNER JOIN tbl_casemaindata MDA ON MDA.intCaseID = MAN.intCaseID
INNER JOIN tbl_casemaindetails MDT ON MDT.intCaseID = MAN.intCaseID
INNER JOIN tbl_casemainstatus MST ON MST.intCaseID = MAN.intCaseID
INNER JOIN tbl_casestatus STA ON STA.intCaseStatID = MST.intCaseStatID
INNER JOIN tbl_caseactivitytype ACT ON ACT.intCaseActTypeID = MST.intCaseActTypeID
WHERE MAN.strRequester = '#session.UserData.CUID#'
AND MST.intID = (select max(b.IntID) from tbl_casemainstatus B
where b.intCaseID = MST.intCaseID and
b.dtiModified >= MST.dtiModified
AND MST.intcaseStatID >= 8
AND (MDA.dtiCaseComplete BETWEEN DateAdd("d", -30, GetDate()) AND DateAdd("d", -1, GetDate()))
ORDER BY MAN.intCaseID