6 Replies Latest reply on Nov 22, 2018 2:33 PM by Daniel Ferreyra

# Number of Sundays between two dates

Greetings Data Lovers!

I would like to create a calculated field to know the number of Sundays between an start date and an end date.

Where the startdate is: MIN([Date])

and the enddate is EOM, which its formula is: {FIXED YEAR([Date]), MONTH([Date]):MIN(DATETRUNC('month',DATEADD('month',1,[Date]))-1)}

I have made the sum of the following calculated field for the number of Sundays

Thanks!

• ###### 1. Re: Number of Sundays between two dates

Hi Daniel,

So to calculate Days between Minimum date per month and Month end date, this should work. I used your data.

Thanks

Deepak

If It Helps, Pl Mark it Helpful and CORRECT to close Thread

• ###### 2. Re: Number of Sundays between two dates

Hey Deepak, Iam looking for the number of Sundays, between those dates . Can you help me with it please?

• ###### 3. Re: Number of Sundays between two dates

Hi Daniel,

Please try with this logic  -

int( (DATEDIFF('day',[Start Date,[End Date])

+

DATEPART('weekday',[Start Date])) /7 )

+

(if DATEPART('weekday',[Start Date]) = 1 then 1 else 0 end) -

(if DATEPART('weekday',[End Day]) = 7 then 1 else 0 end)

Reagrds,

Aman

• ###### 4. Re: Number of Sundays between two dates

Please check the attached workbook.

Count number of Mondays, Tuesdays etc.

~Tushar

• ###### 5. Re: Number of Sundays between two dates

Hi,

Please find the below attachment marked as Correct or Helpful if it is working.

Thanks,

Amar D. Savale

1 of 1 people found this helpful
• ###### 6. Re: Number of Sundays between two dates

Hey Tushar!

I adapted what you did and worked totally fine! Thanks a lot!