For EXTRACT is better if you use the HQL function (HQL are multi-RDBMS)select count(*), month(a.FinishDate), year(a.FinishDate) .......
NH will translate "month(a.FinishDate)" with the appropriate FB sentence. 2009/6/4 Darius Damalakas <[email protected]> > > I am issuing a query with groups tasks by the month they where > finished. > However, this sql is in plain sql. Is it possible to use firebird > function EXTRACR with HQL or CriteriaAPI? > > This is my original query: > IList results = session.CreateSQLQuery( > @" SELECT count(*), > EXTRACT (MONTH FROM a.FINISH_DATE) as mmonth, > EXTRACT (Year FROM a.FINISH_DATE) as yyear > FROM PUV_TASK a > GROUP BY mmonth, > yyear > order by > yyear, mmonth").List(); > > Thanks! > > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
