I am trying to populate a DBGrid with a result set from an Aurelius ORM query.
This is the SQL that works:
select max(c_date), st.last, st.first, st.id_student from tblContact c
inner join tblstudent st on st.id_student = c.id_student
group by st.id_student
order by c_date
To start, I created a simple query with no projections:
AureliusDataset2.SetSourceCriteria(AMgr.Find<TtblContact>().OrderBy('c_date'));
This populates the grid with values.
But when I tried to add my "group by" and "max" projections, nothing displays in my DBGrid:
AureliusDataset2.SetSourceCriteria(AMgr.Find<TtblContact>()
.SetProjections(TProjections.ProjectionList
.Add(TProjections.Group('id_student'))
.Add(TProjections.Max('c_date')))
.OrderBy('c_date')
);
I also tried it with DBAdvGrid, with same results.
What is missing from my ORM query that I get a list of records but no fields in my grid?
Thanks in advance to everyone for your help. I learn a lot from following your posts.