I want to query for records of a month, except that month's last year. my soql query is this
select id,name from opportunity where CreatedDate=THIS_MONTH And WEEK_IN_MONTH IN (1,2,3)
soql query to get the whole month, except its last week.
Yoou tagged it apex so can you cheat?
Date today = System.today();
Integer cutoff = Date.daysInMonth(today.year(), today.month()) - 7;
System.debug([SELECT Id
FROM Opportunity
WHERE CreatedDate=THIS_MONTH AND DAY_IN_MONTH(CreatedDate) < :cutoff]);