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...
Creating formula fo...
 
Notifications
Clear all

Questions Creating formula for GI

 
Acumatica Generic Inquiries & Pivot Tables
Last Post by Royce Lithgo 3 years ago
2 Posts
2 Users
3 Reactions
887 Views
RSS
Nur Syafika
Posts: 8
 Nur Syafika
Topic starter
September 26, 2022 2:40 am
(@nsyafika)
Active Member
Joined: 3 years ago

Hi All,

I would like to add column for this status. However, there's might wrong with my coding since i can't found any data for Expired >= 2 Years and Expired <= 3 Months.

Expiry Status:

Expired < 2 Years
Expired >= 2 Years
Expired <= 6 Months
Expired <= 3 Months =IIf([IspkpCompanyOperatorLicense.EndDate] <Today() AND [IspkpCompanyOperatorLicense.EndDate]<DateAdd([IspkpCompanyOperatorLicense.EndDate] , 'y', 2 ), 'Expired< 2 Years', IIf([IspkpCompanyOperatorLicense.EndDate] <Today() AND [IspkpCompanyOperatorLicense.EndDate]>=DateAdd([IspkpCompanyOperatorLicense.EndDate] , 'y', 2 ), 'Expired >= 2 Years', IIf([IspkpCompanyOperatorLicense.EndDate] >=Today() AND [IspkpCompanyOperatorLicense.EndDate]<=DateAdd([IspkpCompanyOperatorLicense.EndDate] , 'd', 180 ) , 'Expired <=6 Months', IIf([IspkpCompanyOperatorLicense.EndDate] >=Today() AND [IspkpCompanyOperatorLicense.EndDate]<=DateAdd([IspkpCompanyOperatorLicense.EndDate] , 'd', 90 ), 'Expired <= 3 Months', 'False'))))

 

Thank you


azhar reacted
1 Reply
Royce Lithgo
Posts: 557
 Royce Lithgo
September 26, 2022 8:48 pm
(@roycelithgo)
Honorable Member
Joined: 6 years ago

Try this:

=IIf([IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'y',2), 'Expired more than 2 Years',
IIf([IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'d',180), 'Expired 6 months to 2 Years',
IIf([IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'d',90), 'Expired 3 to 6 Months',
IIf([IspkpCompanyOperatorLicense.EndDate] < Today(), 'Expired less than 3 Months', 'False'))))

I changed your labels so that they made more sense to me. To check for cutoff dates, you need to apply DateAdd formula to Today(). 

Here's an alternate version using Switch():

=Switch([IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'y',2), 'Expired more than 2 Years',
[IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'d',180), 'Expired 6 months to 2 Years',
[IspkpCompanyOperatorLicense.EndDate] < DateAdd(Today(),'d',90), 'Expired 3 to 6 Months',
[IspkpCompanyOperatorLicense.EndDate] < Today(), 'Expired less than 3 Months',
True,'False'))))


Reply
Tim Rodman and azhar reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 7 Online
  • 2,338 Members
Our newest member: Shoaib Shafquat
Latest Post: Pick List report suddenly not splitting on Shipment
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

  • Tim Rodman
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.

‹›×

    ‹›×