AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Generic I...
DateDiff between sh...
 
Notifications
Clear all

Questions DateDiff between shipment created and shipped just gives me zeros

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Tim Rodman 8 years ago
11 Posts
3 Users
0 Reactions
6,311 Views
RSS
daniel
Posts: 92
 daniel
Topic starter
April 8, 2018 11:49 pm
(@daniel)
Estimable Member
Joined: 6 years ago

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?


10 Replies
Shawn P Slavin
Posts: 196
 Shawn P Slavin
April 9, 2018 9:07 am
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

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


Reply
Shawn P Slavin
Posts: 196
 Shawn P Slavin
April 9, 2018 2:28 pm
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

Daniel,

I recreated your calculation in 2018 R1 this morning and it produced the results I was expecting. Which version are you using?


Reply
daniel
Posts: 92
 daniel
Topic starter
April 9, 2018 4:35 pm
(@daniel)
Estimable Member
Joined: 6 years ago

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?

 


Reply
Shawn P Slavin
Posts: 196
 Shawn P Slavin
April 10, 2018 8:56 am
(@shawn-p-slavin)
Estimable Member
Joined: 6 years ago

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.

 

Right-click to Download


Reply
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
April 11, 2018 9:28 pm
(@timrodman)
Famed Member
Joined: 10 years ago

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?


Reply
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
April 11, 2018 9:31 pm
(@timrodman)
Famed Member
Joined: 10 years ago

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.


Reply
daniel
Posts: 92
 daniel
Topic starter
April 13, 2018 1:15 am
(@daniel)
Estimable Member
Joined: 6 years ago

Sorry by wrapping it in the CDate() formula, what should the end formula look like? Like this?: CDate(DateDiff('d',[SOShipment.ShipDate],[SOShipment.CreatedDateTime]))


Reply
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
April 13, 2018 5:03 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Just wrap the CreatedDateTime portion in CDate like this:

=DateDiff('d',[SOShipment.ShipDate],CDat([SOShipment.CreatedDateTime]))

Reply
daniel
Posts: 92
 daniel
Topic starter
April 17, 2018 2:36 am
(@daniel)
Estimable Member
Joined: 6 years ago

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!

 


Reply
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
April 17, 2018 9:38 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Ah ha! That would do it. Interesting that DateDiff is smart enough to look at the time element. I wouldn't have anticipated that.


Reply
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 15 Online
  • 2,411 Members
Our newest member: thollings
Latest Post: Generic inquiry with information from Audit history(CT301000)
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

  • Eirik Nilsen
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×