Date Calculation

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
bhossman
Posts: 7
Joined: Tue Oct 10, 2017 12:44 pm

Date Calculation

Post by bhossman » Wed May 19, 2004 9:59 am

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

pdempsey
Posts: 56
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Date Calculation

Post by pdempsey » Thu May 20, 2004 3:44 am

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-

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Date Calculation

Post by kfleming » Thu May 20, 2004 7:25 am

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__

bhossman
Posts: 7
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Date Calculation

Post by bhossman » Thu May 20, 2004 12:53 pm

Thanks,__I did just that and using those UDF^s I was able to do exactly what I was trying to do. ____Thanks again !!!!

bhossman
Posts: 7
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Date Calculation

Post by bhossman » Thu May 20, 2004 12:54 pm

Thanks, that helped.

Post Reply