I want to return all records that have the RenewalDte falling in the 6th month from the month the sql is run. I've figured it as a query in Access 2007 but can't seem to get it to work as an sql statement. Hopelessly lost, any help is appreciated. The statement the won't work is below.
strSql = = CurrentDb
strSql = "SELECT Owners.Owner, Owners.FOorSA, Owners.NameFirst, Owners.NameLast, " _
& "Owners.OState, Renewal.SalesLastYr, Renewal.YrToDate, " _
& "Renewal.LastYrToDte, Renewal.RenewalDte, Renewal.NewRate, " _
& "Renewal.Rate, Renewal.LTM, Renewal.STARRate, Owners.Notes " _
& "FROM Owners INNER JOIN Renewal ON Owners.Owner = Renewal.Comp " _
& "WHERE FOorSA = '" & strOwner & "'" AND ((Year(RenewalDte)*12+DatePart("m",RenewalDte))=Year(Date())*12+DatePart("m",Date())+6))
strSql = = CurrentDb
strSql = "SELECT Owners.Owner, Owners.FOorSA, Owners.NameFirst, Owners.NameLast, " _
& "Owners.OState, Renewal.SalesLastYr, Renewal.YrToDate, " _
& "Renewal.LastYrToDte, Renewal.RenewalDte, Renewal.NewRate, " _
& "Renewal.Rate, Renewal.LTM, Renewal.STARRate, Owners.Notes " _
& "FROM Owners INNER JOIN Renewal ON Owners.Owner = Renewal.Comp " _
& "WHERE FOorSA = '" & strOwner & "'" AND ((Year(RenewalDte)*12+DatePart("m",RenewalDte))=Year(Date())*12+DatePart("m",Date())+6))