Skip to main content
Solved

Created Time in Generic Inquiry


hayleehicks
Varsity I
Forum|alt.badge.img

Has anyone been able to take the shipment (or another similar transaction) created date/time field and only display the time? I was able to use the CRCase table trick to get the date column to display the date and time, but the client would like the time in a separate column. When I try to take the right most characters from the field, it displays the time in UTC time instead of our current time zone like the date/time field displays .

Best answer by Gabriel Michaud

@hayleehicks18 not very elegant but that works:

=CSTR(PADLEFT(HOUR([SOShipment.CreatedDateTime]),2,'0'))+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')

It will display time in 24H format. 12H display could be achieved with an IIF Statement:

=IIF(HOUR([SOShipment.CreatedDateTime])<=12,PADLEFT(CSTR(HOUR([SOShipment.CreatedDateTime])),2,'0')+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')+ ' AM',PADLEFT(CSTR(HOUR([SOShipment.CreatedDateTime])-12),2,'0')+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')+ ' PM')

 

View original
Did this topic help you find an answer to your question?

4 replies

Gabriel Michaud
Captain II
Forum|alt.badge.img+10

@hayleehicks18 not very elegant but that works:

=CSTR(PADLEFT(HOUR([SOShipment.CreatedDateTime]),2,'0'))+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')

It will display time in 24H format. 12H display could be achieved with an IIF Statement:

=IIF(HOUR([SOShipment.CreatedDateTime])<=12,PADLEFT(CSTR(HOUR([SOShipment.CreatedDateTime])),2,'0')+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')+ ' AM',PADLEFT(CSTR(HOUR([SOShipment.CreatedDateTime])-12),2,'0')+'h'+PADLEFT(CSTR(MINUTE([SOShipment.CreatedDateTime])),2,'0')+ ' PM')

 


hayleehicks
Varsity I
Forum|alt.badge.img
  • Author
  • Varsity I
  • 109 replies
  • April 8, 2021

@Gabriel Michaud Hi Gabriel! Thanks for the response. Do you know how I could get it to display in the same time zone conversion as the created on displays? The formula displays the time in UTC time. Also daylight savings may be a factor here. See below. Thanks for your help!

 

 


Gabriel Michaud
Captain II
Forum|alt.badge.img+10

No easy way i’m afraid. It would be great if Acumatica simply exposed the time as an extra field, just like you can get the hour by appending _Hour to the field name: SOShipment.CreatedDateTime_Hour 

Two possible options:

Option 1: just shift the hour manually by adding/subtracting from the UTC time. This will not take care of daylight savings or users in different time zones

Option 2: through customization create a field with a special attribute that takes care of the formatting; you would then be able to use this field as schema field in any GI


Freeman Helmuth
Varsity III
Forum|alt.badge.img

@Gabriel Michaud  do you know if there’s a better way to accomplish this now than there was 2 years ago?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings