Expressions in delete statement AX 2012 R2

Hello guys,

Im trying to do this delete statement, but it has a error, “Invalid use of WHERE expression”, I just want to delete records where date y less than today (mm/dd/yyyy) but the field CREATEDDATETIME return mm/dd/yyyy hh/mm/s and I trying to get only mm/dd/yyyy

Is there another form to do this?

date todayDate;

todayDate = DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(DateTimeUtil::getSystemDateTime(),Timezone::GMTMINUS0600GUADALAJARA_MEXICOCITY));

delete_from inventJournalTable

where inventJournalTable.JournalNameId == inventSite.GMA_InventJournalNameCyclicId

&& inventJournalTable.Posted == NoYes::No

&& DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(inventJournalTable.createdDateTime,Timezone::GMTMINUS0600GUADALAJARA_MEXICOCITY)) < todayDate;

anyone can help me?