I'm writing an Candidature Manager application which can use a SQL Server or Firebird database to store the datas.
I want to write an HQL query which search for a Candidature list which have a date > A_DATE.
But I have some matter because of the difference between date format in
the 2 databases. Indeed, the date format are :
* SQL Server : 'dd/MM/yyyy'
* Firebird : 'MM/dd/yyyy'
So this HQL query is Ok with one database and thrown an exception with the other :
Code:
"SELECT c FROM Candidature as c WHERE c.Date > 10/20/2005'"
Is it possible to set change the date format of a database with NHibernate ?
Because I don't want to be forced to do something like this :
Code:
string str;
if (SQL Server)
str = date.ToString("dd/MM/yyyy");
else
str = date.ToString("MM/dd/yyyy");