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 Report De...
Date Math Issues
 
Notifications
Clear all

Questions Date Math Issues

 
Acumatica Report Designer
Last Post by Tim Rodman 6 years ago
4 Posts
3 Users
0 Reactions
2,592 Views
RSS
MichaelHansen
Posts: 149
 MichaelHansen
Topic starter
September 23, 2019 4:04 pm
(@michaelhansen)
Estimable Member
Joined: 5 years ago

Hey Everyone, 

 

I know the date formulae are a bit rough, but I'm being asked to run 12 Weeks of data (in weekly buckets) Followed by monthly buckets until I've hit Month 6.

Getting 12 Weeks was easy, I ran 12 variables, each with =DateAdd(today(),'d',7), for week 1 and increasing until =DateAdd(today(),'d',84), which is week 12. I'm stuck on how to define the end of the month that Week 12 lands on, further complicated by the fact that Week 12 could BE the last day of the month. 

Anyone here a super genius with Date Math? I have a variable $Month3 that comes after $Week12 (I am aware it could technically be month 4, depending on our start date) that I cannot figure out how to design.

The date math doesn't seem to have functions like MonthEnd(), which would make life easy, as I'd do a date diff on $Week12 and MonthEnd($Week12), if it's non-zero, assign MonthEnd() to $Month3 (So I catch the rest of the month), if not Assign the next month's end using DateAdd ($week12 was already at month end, so increment to next month). Am I overlooking something simple? I'm feeling kind of dumb on this one, math is usually my happy place...

 

As always, thanks in advance for your assistance everyone!


Topic Tags
Datediff DateAdd Date Math Month End Time Buckets
3 Replies
Hazen Metro
Posts: 31
 Hazen Metro
September 24, 2019 9:49 am
(@hazenm)
Eminent Member
Joined: 5 years ago

Hey Michael,

Could you do something like this to give you the start of month 3?

Dateadd(today(),'d',84 -  (Dayofweek(Dateadd(today(),'d',84))+1))

Or are you looking for calendar months? As in, if 12 weeks got you to mid-december, you need to find December 1 to start the next batch? That would be tricky as I don't believe there is a function for Date(Day,Month,Year) is there?


Reply
MichaelHansen
Posts: 149
 MichaelHansen
Topic starter
September 24, 2019 10:46 am
(@michaelhansen)
Estimable Member
Joined: 5 years ago

If the $Week12 date was December 20th, I'd like $Month3 to be December 31st. If $Week12 was December 31st, I'd like $Month3 to be January 31st. I'm trying to either finish the month (no gaps) or jump to the next month (no overlap). The tools we're given are a bit rudimentary and perhaps I just need to make two versions of the report, one running strictly in weeks, and one running in months. That would be simple to implement, but obviously less aligned for the use-case I was given. 


Reply
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
October 23, 2019 12:07 am
(@timrodman)
Famed Member
Joined: 10 years ago

Hey Michael,

I haven't solved the problem when it's the last day of the month, but what about this technique?

Using this formula on the Sales Order Date:

=DateAdd(DateAdd([SOOrder.OrderDate],'m',1),'d',-Day([SOOrder.OrderDate]))

 

The result turns out like this:


Reply
Forum Jump:
  Previous Topic
Next Topic  
Topic Tags:  Datediff (3) , DateAdd (1) , Date Math (1) , Month End (1) , Time Buckets (1) ,
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 27 Online
  • 2,324 Members
Our newest member: Michael Kiley
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

 No online members at the moment

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.

‹›×

    ‹›×