Question

Share a way to Calculate datetime intervals in GI style comlumn/Row style.

  • 17 October 2023
  • 0 replies
  • 22 views

Userlevel 6
Badge +5

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”

 

      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.


0 replies

Be the first to reply!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved