Page 1 of 1

Date Calculation

Posted: Wed May 19, 2004 9:59 am
by bhossman
I am trying to write a calculated field or UDF that will allow me to count days between two dates "but without counting weekends" any help would be apprciated. Also anyplace I can go to find udf^s or calculated fields that people share with each other ?____Thanks

=> RE: Date Calculation

Posted: Thu May 20, 2004 3:44 am
by pdempsey
I would try this approach to see if it would work.__If you divide the days between dates (a built in function) by 7 you will get the number of weeks. Each whole week has a weekend, so you can subtract two days for each whole week. Then you^ll need some iif statements to check the start day for periods less than 7 days and the end date^s day of week for the instance where there is a remainder to your division (MOD function). For example if the remainder is 1, representing one day, and the last day is Sat or Sun, you need to subtract 1 additional day.____It may take more than one function. Might not be elegant :-)__-Pat-

==> RE: Date Calculation

Posted: Thu May 20, 2004 7:25 am
by kfleming
Go to http://www.livewarepub.com/technote.htm and look at the article __Assorted Tips and Tricks.__This page also has UDF file you can download that includes a week days between calculation.____Kathleen__R&R Support__

==> RE: Date Calculation

Posted: Thu May 20, 2004 12:53 pm
by bhossman
Thanks,__I did just that and using those UDF^s I was able to do exactly what I was trying to do. ____Thanks again !!!!

===> RE: Date Calculation

Posted: Thu May 20, 2004 12:54 pm
by bhossman
Thanks, that helped.