ibatis.net datetime and dynamic sql

1.3k Views Asked by At

how can i test if a property of type dateTime contains value on dynamic sql statement with ibatis.net my mapping file is as follow, but it does not work

<select id="Select" resultMap ="CongeResult" parameterClass="Conge">
  SELECT * FROM Conge
  <dynamic prepend="WHERE">
    <isGreaterThan property="StartDate" compareValue="01/01/0001 00:00:00">
      START_DATE >= #StartDate#
    </isGreaterThan>        
  </dynamic>
</select>

thanks in advance.

1

There are 1 best solutions below

0
On

Try specifying the Date/Time value in ISO 8601 format http://en.wikipedia.org/wiki/ISO_8601. Most parsers will correctly parse that string representation. Your value will be parsed if you type:

compareValue="0001-01-01 00:00:00"