Hello,
Still in 2021R2, I don’t know if latest version still having this issue.
The datatime manipulating functions like DateDiff( 'd', DateFrom],FDateTo]) can work perfectly when put in data field like below. But when you put it in styles, it would run with error “mismatch type”
It probably due to Acumatica did not handle it in style columns.
Luckily, we can handle this ourself. Like below:
(DateDiff( 'd', CDate( Replace( DDateFrom],' 12:00:00 AM', '') ),CDate( Replace( DDateTo],' 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.