Get database specific date formats for MBO queries

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.

Did You Know...

As Maximo Experts, we have developed several add-on products for Maximo that mobilize the work force, simplifies assignments, provides ad-hoc reporting capabilities and facilitates the seamless integration of Service Requests into Maximo.

Check out our products by clicking on the following links: EZMaxMobileEZPlanner and EZInsight.

Find Out More

Leave a Reply