I was a little too quick to close my last question. I have capricorn's code:
strSQL = "SELECT * FROM MIR.ReportData WHERE ReportingDate BETWEEN date() and DateSerial(Year(Date()), (Month(Date()) - 13), 1)
But I'm getting an 'ODBC call failed' error. I think it's around the formatting of the date. This is pulling from Teradata and the format has to be yyyy/mm/dd. I tried this, but am still getting the error.
strSQL = "SELECT * FROM MIR.ReportData WHERE ReportingDate BETWEEN Format(Date(), 'yyyy/mm/dd')and Format(DateSerial(Year(Date()), (Month(Date()) - 13), 1), 'yyyy/mm/dd')"
Any ideas? Thanks!
strSQL = "SELECT * FROM MIR.ReportData WHERE ReportingDate >= " & format(now(),"YYYYMMDD") & " AND ReportingDate <= " & format(DateSerial(Year(Now