How can one group by a table based on only the date part of the CreatedDateTime field in X++ in dynamics AX? I can use the following statement in the sql server and get what I want but I don't know the way to do same in X++.
select COUNT(RECID) from WMSORDERTRANS
GROUP BY CAST( FLOOR( CAST( CREATEDDATETIME AS FLOAT ) ) AS DATETIME )
In X++ I tried, DateTimeUtil::date(wmsOrderTrans.CreatedDateTime) but I cannot use it in while select statement.