Focal Point
[CLOSED] Finding the number of business days (M-F) between two dates.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9907079506

June 24, 2011, 04:06 PM
Denny99
[CLOSED] Finding the number of business days (M-F) between two dates.
I'm working with WebFocus 7.1.4 and trying to create an aging report. I need to be able to have two dates (From and to) and from here I need to calculate how many business days are between these two dates. Also, is there a way to exclude the basic holiday such as New Years and Christomas? Many thanks!

This message has been edited. Last edited by: Kerry,
June 24, 2011, 04:16 PM
Dan Satchell
Take a look at functions DATEDIFF and HDIFF, depending on the type of date.


WebFOCUS 7.7.05
June 24, 2011, 04:53 PM
Waz
There is also a file that can be loaded with holidays, I think its called HDAY.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

June 26, 2011, 04:40 PM
FrankDutch
it is the younameit.ERR file you need
that is a flat file holding the holidays you have

then you have to SET HDAY=YOUNAMEIT

your business days calculation will use this file




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

June 27, 2011, 04:59 PM
Denny99
Hi Dan,
Thanks for the reply. I tried using the HDIFF with the 'BD' parameter and it didn't calculate. I also used the set comnad to -Set BUSDAYS = _mtwtf_? Any ideas as to why it didn't work. I received no error it just aged everything to 0. Unfortunately, space is so limited here I'm unable to create external flat files to bring in data. Thanks a million!
June 27, 2011, 05:06 PM
Denny99
Hi FrankDutch, Thanks for the reply. The issue I have with this solution is that I don't have the ability to create a flatfile. The company I work for does not allow us the ability because of space restraints. Thanks again
June 27, 2011, 05:08 PM
Denny99
Hi WAZ, thanks for the reply! Unfortunately, I don't have the ability to create a flatfile to read in because of space restraints imposed by my company. Thanks again
June 27, 2011, 05:34 PM
Dan Satchell
On closer examination, HDIFF may not do business days. Instead, convert your date-time values to SmartDates and then use DATEDIFF.


WebFOCUS 7.7.05
June 27, 2011, 06:00 PM
Waz
If you can get the number of days between two dates, and you have a list of holidays, then you should be able to calculate the business days.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

November 03, 2015, 08:22 AM
Ricardo Augusto
I cant get expected results using DATEDIF and BUSDAYS.


WebFOCUS 8.1.05 / APP Studio
November 03, 2015, 08:28 AM
Tom Flynn
Try not creating multiple posts for the same topic...

http://forums.informationbuild...1057331/m/1717081976http://forums.informationbuild...1057331/m/1717081976[/url


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe