We help IT Professionals succeed at work.
Get Started

Calculate Weeks in A "Fiscal Month"

Graham Gibson
on
464 Views
Last Modified: 2017-04-27
Our companies fiscal year starts on the last Sunday in July. Each month starts on the last Sunday of the previous month. I will be given a date and I will have to give the number of weeks in that "Fiscal Month". For example

Su      M      T      W      Th      F      S
August                                    
31      1      2      3      4      5      6
7      8      9      10      11      12      13
14      15      16      17      18      19      20
21      22      23      24      25      26      27
September                                    
28      29      30      31      1      2      3
4      5      6      7      8      9      10
11      12      13      14      15      16      17
18      19      20      21      22      23      24
October                                    
25      26      27      28      29      30      1
2      3      4      5      6      7      8
9      10      11      12      13      14      15
16      17      18      19      20      21      22
23      24      25      26      27      28      29

August and September only has 4 weeks. October has 5 weeks.  
I would prefer not to build a table for each fiscal year show the number of weeks for the month for the date given. I had thought of select case statements but I haven't been able to get my arms around this yet. Thanks for any help.

Graham
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE