How trunc datetime field to date with Aurelius

Hi, I need get a field TDateTime datatype as TDate only. I'm using GraphQL with Aurelius and I needing group by as TDate.

Thanks.

Esteban

I found that SQL standard is supported using cast, but I don't know as do it with Aurelius using TCriteria. Is there something similar to cast for use in Aurelius with TCriteria ?

Thanks.

Esteban

Not built-in, but you can always create your own functions then use the SqlFunction projection.

However, I would suggest what I consider a simpler way, if you just want to group, use Year, Month and Day projections, and group by then in that order.

I would suggest to add .DateOf to the list of SqlProjections. I think is used very often and the Year/Month/Day combination is a little clumsy.

I personally think .DateOf is less portable and less flexible. Year, Month and Date return simple integer values (not dates) and can be used individually (group by year and month, for example).