AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register

— The Forums are now read-only —

— All new activity now takes place here: —

AugForums.com Discord Server
Forums
AUG Forums
Acumatica Generic I...
Date Difference in ...
 
Notifications
Clear all

Questions Date Difference in year and month

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Tahir Siddiqui 3 years ago
8 Posts
4 Users
6 Reactions
4,484 Views
RSS
Britt Steinhardt
Posts: 5
 Britt Steinhardt
Topic starter
January 4, 2022 8:10 am
(@britt-steinhardt)
Active Member
Joined: 6 years ago

I am trying to calculate a date difference [start date {an attribute} with today's date, in a generic inquiry that shows year(s) and month(s). We would like to know how long a company has been a customer, i.e. 2 yrs and 2 mths....from what I can tell in a GI you can either do 'year(s)' or 'month(s)'...using the year formula it seems to round the year up to 3 years and using months I get 26 months (which is great, but just to hard to convert to year, month in ones' head) if I divide the formula by 12, I get 3 instead of 2.166).

Thanks in advance for the help.


Kathy Muczynski reacted
7 Replies
Wyatt.ERP
Posts: 128
 Wyatt.ERP
January 5, 2022 10:47 am
(@wyatt-erp)
Estimable Member
Joined: 6 years ago

Hi @britt-steinhardt, try these:

Years:

=CINT(DateDiff( 'M', [START DATE], Today())/12)

Months:

=DateDiff( 'M', [START DATE], Today())%12

Reply
Britt Steinhardt
Posts: 5
 Britt Steinhardt
Topic starter
January 5, 2022 11:54 am
(@britt-steinhardt)
Active Member
Joined: 6 years ago

Thanks - that worked great as separate columns/calculations, is it possible to combine the two formulas so that the result looks something like this - 1 yr 2 mths, we would ultimate like to highlight the rows that show 6 months, 5 years, 10 years...etc.


Reply
Wyatt.ERP
 Wyatt.ERP
(@wyatt-erp)
Joined: 6 years ago

Estimable Member
Posts: 128
January 5, 2022 1:16 pm
Reply toBritt SteinhardtBritt Steinhardt

@britt-steinhardt 

This should work:

=IIF(DateDiff( 'D', [Batch.DateEntered], TODAY()) < 30, 'New'  ,IIF(CINT(DateDiff( 'M', [Batch.DateEntered], TODAY())/12) < 1,'',CSTR(CINT(DateDiff( 'M', [Batch.DateEntered], TODAY())/12)) +  'yr ')   + IIF(DateDiff( 'M', [Batch.DateEntered], TODAY())%12=0,'',CSTR(DateDiff( 'M', [Batch.DateEntered], TODAY())%12)+ ' mth'))

Reply
Kathy Muczynski reacted
Britt Steinhardt
Posts: 5
 Britt Steinhardt
Topic starter
January 5, 2022 1:53 pm
(@britt-steinhardt)
Active Member
Joined: 6 years ago

That worked perfectly!!....thanks so much for your help, greatly appreciated.


Reply
Tim Rodman and Wyatt.ERP reacted
Tahir Siddiqui
Posts: 3
 Tahir Siddiqui
February 10, 2023 12:20 am
(@tahirsiddiqui)
New Member
Joined: 4 years ago

Dear Sir ;

when i subtract enddate - today() its count wrong days can u guide me

image

 my formula :  DateDiff('d',(TODAY()),( [AMProdOper.EndDate]))


Reply
Royce Lithgo
Posts: 557
 Royce Lithgo
February 12, 2023 7:35 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

Looks correct to me.

image

Reply
Tim Rodman reacted
Tahir Siddiqui
Posts: 3
 Tahir Siddiqui
February 15, 2023 1:34 am
(@tahirsiddiqui)
New Member
Joined: 4 years ago
3081 image

 

any one guide me this is show wrong no of days 


Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,533 Topics
  • 11 K Posts
  • 51 Online
  • 2,438 Members
Our newest member: Ralph Torres
Latest Post: Nested SubReport Issue
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

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

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

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

‹›×

    ‹›×