Hi, I want to write a Projection query in NHibernate that groups records by date and counts "Tax" field value for those records. My question is that the database has the value as DateTime, who will I group just records just by date and not time.Below is my code
Code:
template.Criteria.SetProjection(
Projections.ProjectionList()
.Add(Projections.GroupProperty("IssueDatetime"), "DateVal")
.Add(Projections.Sum("Tax"), "TotalFare")
);
The database stores the IssueDatetime field as DateTime type. I want to count the Tax per date and ignore the time part. How to do that?