Tried KenHammady solution for calculating business hours but no joy. I get error for NumberVar Days := {@Business Days Formula}; "This field name is not known". It's the first time I work with Crystal and obviously am doing something wrong. Please, help!
Hi IanWaterman and thanks for replying. Below is what I’m using to calculate business days and hours, skipping weekends. These are KenHammady solutions I found a few days ago and am trying to put them together. Programming is not my cup of tea. I’m doing it because there’s nobody else. I appreciate your help.
//Main formula
WhileReadingRecords;
Local DateVar Start := date({my.field.1}); // place your Starting Date here
Local DateVar End := date({my.field.2}); // place your Ending Date here
Local NumberVar Weeks;
Local NumberVar Days;
WhileReadingRecords;
NumberVar Days := {@Business Days Formula}; // The field that calculates your business days
TimeVar SetStart := TimeValue( "8:00"); // The start your work day
TimeVar SetEnd := TimeValue("17:00"); // The end your work day
TimeVar StartTime := TimeValue({my.field.1});// The data field that holds your Start Time
TimeVar EndTime := TimeValue({my.field.2}); // The data field that holds your End Time
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.