Crystal Reports Training by Ken Hamady, MS, Reporting and Training Nationwide On Location TrainingPublic ClassesIndividual TrainingIntroductory Course OutlineAdvanced Course OutlineFormula ExamplesNewsletter Back IssuesMy BlogResource LibraryConsulting ServicesSupport ServicesContact InformationLinks to third party productsBack to main pageMy Credentials
Free Crystal Reports formula examples from KenHamady.com


To learn the techniques used in these formulas get:


The Expert's Guide to Crystal Reports Formulas
and
 Expert Techniques for Crystal Reports I, II & III

How to Find the number of Fridays in a date range (or any other day of the week):

The following formula will allow you to count the number of Fridays in any date range.  Your input dates can be database fields, formula fields or parameter fields.  The Input Dates goes in place of {StartDate} and {EndDate} .   You can change the formula to count another day of the week by changing the number 6 to any number from 1 to 7.  Use 1 for Sunday and 7 for Saturday, etc. 

Note 
- You should subtract one day from the start date if you want date ranges that start on Friday to include that first Friday in your count.   In other words if an 8 day range from Friday to Friday should count 2 Fridays.


    DateDiff ( 'ww' , {StartDate} - 1 , {EndDate} , 6  )