Dear community,
I'm trying to execute the following HQL-Statement to get an overview of orders:
Code:
select count(custOrder), custOrder.Created from CustomerOrder as custOrder group by custOrder.Created order by custOrder.Created
This works out, but in my database the "Created"-field is a DateTime-field so the aggregate is done for every distinct hh:MM:ss of each day.
I would like to count the orders of ONE day (all 24 hours).
So I suggested something like the following
Code:
select count(custOrder), date(custOrder.Created) from CustomerOrder as custOrder group by date(custOrder.Created) order by date(custOrder.Created)
Didn't work so I tried:
Code:
select count(custOrder), {fn date(custOrder.Created)} from CustomerOrder as custOrder group by {fn date(custOrder.Created)} order by {fn date(custOrder.Created)}
Didn't work either.
Is there a way to accomplish this task?
Thank you in advance