Field values when using projections

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:
This populates the grid with values.

But when I tried to add my "group by" and "max" projections, nothing displays in my DBGrid: 

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.

Hello Jon,

When using projections (TCriteriaResult objects) you have to create the the dataset fields yourself in advance. Just use aliases and create fields with names, i.e.:


For example, create two fields, student and maxdate in your dataset.

For the benefit of future souls... So if a given query has projections then Arelius doesn't return entities. But we can still output data to the dataset for DB aware components by creating aliases for the fields we want?

Yes, correct.