I have a requirement where I have to write a query with a condition that the Last Modified date should be between 30 and 60 days and this should be configurable by user. I have created a custom setting for this to make it configurable but couldn't find anything to check date between 30 and 60 days. Is there any formula which can help me?
Instead of using custom setting, you can create two new "Custom Lables" and can provide values of 30 & 60 to each. Then use the below lines to retrieve the lables values and put them in your query.
String x= System.Label.Custom_Label_Name; //Retrives custom label value Integer y = Integer.valueOf(x); //Converts custom label value from string to Integer
Hope this helps you!