Skip to main content
Answer

How we can get WeekID from a Date?

  • June 25, 2023
  • 4 replies
  • 341 views

aaghaei
Captain II
Forum|alt.badge.img+10

Hello all,

Do we have a function in Acumatica that we pass a date and returns the WeekID which is used in EPTimeCard.WeekID? The format of WeekID stored in DB I see is “YYYY##” which ## is a sequential counter. I see Acumatica is using EPWeekRaw that has some properties including Start and End Date but I need it opposite. I have the date and I need the equivalent WeekID. I can calculate the Week # but I want to be consistent with what Acumatica does. considering Acumatica has Custom Weeks

 

Best answer by aaghaei

I got it, it is PXWeekSelector2Attribute.GetWeekID(MyDate)

4 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • Answer
  • June 25, 2023

I got it, it is PXWeekSelector2Attribute.GetWeekID(MyDate)


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • June 25, 2023

Thank you for sharing your solution with the community @aaghaei!


Forum|alt.badge.img+1
  • Jr Varsity II
  • July 26, 2023

Is there something similar to be used in reports?  I would like to join the ARTranDate to the DateInfo DAC so I can get the WeekEnding ID and group by the WeekEndingID only I can’t because it is non existent.  Is there an alternative?  I need a report that has sales #’s by week for the past 5 weeks.  Thanks.

 

 

 


aaghaei
Captain II
Forum|alt.badge.img+10
  • Author
  • Captain II
  • July 26, 2023

@dgross

please have a look at the below post. It might be helpful. Report Designer is not my strong suit and honestly I’m not interested in it so I have not spend much time on it.