Wow I can't believe I missed the group by in the HQL. It was a late
night. So I added the group by and below is what it looks like,
however Nhibernate throws this: NHibernate.QueryException: in
expected: [HQL goes here] Still googling this error message, any
ideas? I pasted the full error at the bottom of this post.
//my HQL
session.CreateQuery("from StorageProduct m inner join (select
s.storageID, max(s.asOfDateTime) as asOfDateTime from StorageProduct s
group by s.storageID) on m.asOfDateTime =
s.asOfDateTime") .List<BLL.Storage.StorageProduct>();
//the error
NHibernate.QueryException: in expected: select [from
MMT.Core.BLL.Storage.StorageProduct m inner join (select s.storageID,
max(s.asOfDateTime) as asOfDateTime from
MMT.Core.BLL.Storage.StorageProduct s group by s.storageID) on
m.asOfDateTime = s.asOfDateTime]