One of the biggest challenges of using MBO’s are queries that use date ranges or date values in general. This is because any user can be connected to an Oracle, SQL Server or DB2 instance and they all use dates differently. There is a class called SqlFormat that will help take care of the date formats for you no matter what database you are using. Here is a quick sample of how to get a date as a string:
String dateString = SqlFormat.getDateFunction(new Date());
You can then use this in an MBO where clause without worrying that your date format will be incorrect.