Solved

Function to get difference in time as HOURS and MINUTES

  • 24 November 2022
  • 3 replies
  • 284 views

Userlevel 4
Badge

Trying to get the time difference from when a sales order was created and when it was shipped. The only function I could get was DateDiff. Is it possible to get the time in the format of “HOUR:MINUTE”?

 

=DateDiff( 'MINUTE',[SOShipment.ConfirmedDateTime],[SOOrder.CreatedDateTime])*-1

 

 

 

icon

Best answer by BenjaminCrisman 28 November 2022, 21:55

View original

3 replies

Userlevel 4
Badge

Was thinking of using MOD to achieve what I want as follows

Use this to get hours =DateDiff( 'HOUR', [SOOrder.OrderDate],[ARInvoice.CreatedDateTime],)

And this one to get the minutes.

 DateDiff( 'MINUTE', [SOOrder.OrderDate],[ARInvoice.CreatedDateTime],)%60)

 

The issue is now on how to combine the two. Will appreciate any suggestions on how to achieve this.

Userlevel 7
Badge +17

Hi @development93  This can be achieved easily from the SQL VIEW.

 

Can you please share the GI, so that I can build a SQL view and then create GI accordingly with the HH:MM:SS 

Userlevel 7
Badge +4

@development93 You can also use the Concat() function to get the two differences combined into one field, something like:

=Concat(Cstr(DateDiff('h', [SOOrder.OrderDate], [ARInvoice.CreatedDateTime])+':'+Cstr(DateDiff('n', [SOOrder.OrderDate], [ARInvoice.CreatedDateTime]))

Or did I misunderstand and you just want to SUM them into minutes or hours?

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