Hi all,

I've a DATETIME field and I would like to group records by day using this 
field.

In MySQL I can do that:

SELECT DATE(date_field) AS d FROM my_table GROUP BY d ORDER BY d;

In OrientDB I know the method date() permit to format DATETIME fields.

So I tried something like that but that doesn't work: :(

SELECT date(date_field, 'yyyy-MM-dd') AS d, COUNT(*) from my_table GROUP BY 
d ORDER BY d;

I get this ERROR in console:

Error: com.orientechnologies.orient.core.exception.
OCommandExecutionException: Error on execution of command: sql.select date(
date_field, 'yyyy-MM-dd') AS d, COUNT(*) from my_table GROUP BY d ORDER BY d


Error: java.lang.ClassCastException: java.util.Date cannot be cast to java.
lang.String

Thanks for your help ! :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to