Skip to main content
Solved

How we can get WeekID from a Date?

  • Jun 25, 2023 5:48 AM UTC
  • 4 replies
  • 417 views
  • Translate All

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

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)

View original

4 replies

aaghaei
Captain II
Forum|alt.badge.img+11
  • Author
  • Captain II
  • Answer
  • Jun 25, 2023 5:57 AM UTC

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

Translate

Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • Jun 25, 2023 6:01 AM UTC

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

Translate

Forum|alt.badge.img+1
  • Jr Varsity II
  • Jul 26, 2023 2:30 AM UTC

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.

 

 

 

Translate

aaghaei
Captain II
Forum|alt.badge.img+11
  • Author
  • Captain II
  • Jul 26, 2023 6:32 AM UTC

@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.

 

Translate