Right. In plain English, if the date is after June 6, pick the data that is 45 days older than the system date, if it is before June 6, pick the data that was posted between April 12 and May 12.
In SQL server I would have used BETWEEN, but data services doesn't seem to use it. I also tried using IF and WHERE THEN. Other posts suggested that the ifthanesle was the way to go. Hopefully I just have the syntax wrong.