
1. Re: Counting the number of Sundays in a date range?
Daniel Vincent Feb 19, 2016 9:30 AM (in response to Jeffrey Satz) 
2. Re: Counting the number of Sundays in a date range?
Jeffrey Satz Feb 19, 2016 9:40 AM (in response to Daniel Vincent)How can or should I modify the calculated field I have created.
I currently have:
int([Amount])/DATEDIFF('day', [Start], [Ready])
That fields give me $s per day of work. In the denominator, I need to credit back the number of Sundays.
Thanks again

3. Re: Counting the number of Sundays in a date range?
Shinichiro Murakami Feb 19, 2016 10:41 PM (in response to Jeffrey Satz)Here is a calculation to exclude Sunday.
[d1 without Sunday]
if datename('weekday',[Date1])="Sunday" then [Date1]+1 else [Date1] END
[d2 without Sunday]
if datename('weekday',[Date2])="Sunday" then [Date2]1 else [Date2] END
[days in between]
([d2 without Sunday]+1[d1 without Sunday])
int(([d2 without Sunday]+1[d1 without Sunday])/7)
[days in between (direct)]
((if datename('weekday',[Date2])="Sunday" then [Date2]1 else [Date2] END)+1
 (if datename('weekday',[Date1])="Sunday" then [Date1]+1 else [Date1] END))
int(((if datename('weekday',[Date2])="Sunday" then [Date2]1 else [Date2] END)+1
 (if datename('weekday',[Date1])="Sunday" then [Date1]+1 else [Date1] END))/7)
Thanks,
Shin
9.0 attached

except_Sunday_9.0.twbx 32.3 KB


4. Re: Counting the number of Sundays in a date range?
Swarup K Feb 21, 2016 8:45 PM (in response to Shinichiro Murakami) 
5. Re: Counting the number of Sundays in a date range?
Daniel Vincent Feb 22, 2016 7:37 AM (in response to Jeffrey Satz)To get your denominator I would do something like this...
DATEDIFF('weekday',[Start Date], [End Date])  (DATEPART('week',[End Date])  DATEPART('week',[Start Date]))
Attaching 9.1 workbook for you to review.

Forum.twbx 1.1 MB
