Jump to content
Salesforce and other SMB Solutions are coming soon. ×

WeekOfYear(date)


Maureen

Recommended Posts

Hello,

 

I have used this function in a fairly complex inventory report. When we ran it the week of New Years we had a nasty surprise.

 

Any records with dates from 12/29/2003 through to midnight on 12/31/2003 were set as the 53 week of 2003 and the records from midnight 12/31/2003 to 1/2/2004 are set as the 1st week of 2004.

 

In retrospect this makes sense because I guess the New Year has to start sometime but it really messed up my reporting because it's splits up an inventory week.

 

Does anyone have any idea of how I can force this to NOT split weeks like this? I'm hoping for a simpler solution than redesigning the whole report.

 

Any suggestions would be greatly appreciated.

 

Thanks

 

Maureen

 

:eek:

Link to comment
Share on other sites

Hi Maureen ...

 

Welcome to the Cafe smile.gif

 

What day is the first day of your inventory week? Saturday? Sunday? Monday? This would be needed to construct a calculation.

Link to comment
Share on other sites

Hi, thanks for the welcome

 

I think I actually figured it out, but to answer your question Monday is the first day of the week. I used WeekOfYear((zv globalFindDate+(7-DayofWeek(zv globalFindDate))+1)-6) Rather than the WeekOfYear for just the date. I got the idea using this form and a posting about finding a specific day of the week from any date entered.

 

However, if you have a better solution I'd love to give it a try and thanks for the response.

Link to comment
Share on other sites

Hi Maureen,

Glad to hear that you've made progress towards a solution.

 

FWIW, however, a slightly simpler formula which I think you will find does what you require would be:

 

WeekofYear(YourDate - DayofWeek(YourDate - 1))

 

- where YourDate is the field that holds the date you wish to check the week of. wink.gif

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use