If you have a list of objects with a date and you need to retrieve the lastest record based on the date attribute, you can do this with a query. Just a a retrieve from database. Make sure the custom setting is used to retrieve just 1 record (amount ==1). The set the sorting in the retrieve action to the datetime attribnute and make sure the sorting is done descending. This will result 1 1 record with the largest value for the date field.
The option with the list could also work, just create a variable as datetime with the value addMonths(beginofcurrentMonth, -1) and use this variable in the list find action. Better would be to do the same sort of thin in the retrieve from database by using the created variable in the xpath database retrieve action. This last option will perform much better certainly if you are dealing with large lists as you just retrieve 1 record in stead of a list of all records.