I am setting a string qryDate = 'Last_N_Months:' + x - so it could be Last__Months:3.
I create a string qryString = 'SELECT field1 FROM Case WHERE CreatedDate=: qryDate' and then do: result = Database.query(qryString); I get this error: Invalid bind expression type of String for column of type Datetime
I know CreatedDate = Last_N_Months:3 works so why doesn't mine work?