By using this website, you agree to our Terms of Use (click here)
I'm trying to create a Generic Inquiry to show the number of days it takes for an order to be shipped.
To do this, I'm using the PX.Objects.SO.SOShipment table, and CreatedDateTime and ShipDate in the Results tab. I then added another row with the formula =DateDiff('d',[SOShipment.ShipDate],[SOShipment.CreatedDateTime])

However, when I run the Inquiry, all I get for the formula is 0. Why is this? What am I missing?

I created the same GI with expected results (Build 18.092.0030):


Daniel,
I recreated your calculation in 2018 R1 this morning and it produced the results I was expecting. Which version are you using?
Thanks for this Shawn,
(From the other thread) We are using Myob Advanced Version 2017.1.11.658 [6.10.1511.23]. Myob Advanced hasn't yet got 2017 R2, let alone 2018 R1! Would this be the reason why it's not working?
Â
I recreated the same GI in Version 6.10.0755 with the same desired results. I'm not sure what the issue is. I recommend opening a case with Acumatica.
I have attached the xml for the GI I built just in case you want to test the version I did. I don't expect anything different that what you experienced.
Â
The only thing I can think is that your Acumatica version doesn't like the DateTime format of CreatedDateTime. Have you tried wrapping it in the CDate() formula?

Also, note that this was two separate topics, but I used the new combine topics feature that I have available in the forum software and it appeared to work pretty well.
Sorry by wrapping it in the CDate() formula, what should the end formula look like? Like this?: CDate(DateDiff('d',[SOShipment.ShipDate],[SOShipment.CreatedDateTime]))
Just wrap the CreatedDateTime portion in CDate like this:
=DateDiff('d',[SOShipment.ShipDate],CDat([SOShipment.CreatedDateTime]))
Yep that CDate formula works! .....Turns out that first formula also works 🙄Â
I didn't realise this, but when there was a day difference between Shipment Creation and Shipment Sent, sometimes it must have been less than 24 hours, and therefore showed 0.Â

So as far as I can tell, everything is working fine with this - sorry for not checking this before posting the thread!
Â
Ah ha! That would do it. Interesting that DateDiff is smart enough to look at the time element. I wouldn't have anticipated that.
