Hi
I have a simple nHibernate criteria query which is looking for records with a datetime less than today:
example:
criteria.Add(Expression.Le("TheDate", DateTime.Today));
However, the results I am getting are incorrect when the day/month is ambiguous (eg 12th November 2009 returns the records for 11th December 2009)
I have looked at the SQL generated and the datetime format will show 12/11/2009, and if I run the sql query directly in SQL Manager it will only return the correct results with the date format 11/12/2009.
Is there a way of defining the SQL date format from the criteria expression or do I need to do something to the database table?
Many thanks