Hello,
Still in 2021R2, I don’t know if latest version still having this issue.
The datatime manipulating functions like DateDiff( 'd', [DateFrom],[DateTo]) can work perfectly when put in data field like below. But when you put it in styles, it would run with error “mismatch type”
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/def9ada3-3757-410f-b428-87d019550c5c.png)
It probably due to Acumatica did not handle it in style columns.
Luckily, we can handle this ourself. Like below:
(DateDiff( 'd', CDate( Replace( [DateFrom],' 12:00:00 AM', '') ),CDate( Replace( [DateTo],' 12:00:00 AM', '') ))
Firstly, you have to replace the ' 12:00:00 AM' with empty, note, a space is in front of 12:00:00
Secondly, you use Cdate to forcely convert the type.
Then, you can use Datediff function as usual, no errors anymore.