Crystal Reports networkdays?

Please take a look at http://www.kenhamady.com/form01.shtml



--- In vantage@yahoogroups.com, "Ken Williams" <ken@...> wrote:
>
> Since I couldn't find a premade function, here's one I modified to
work
> with Crystal:
>
> numbervar intCount;
> numbervar StartMonth;
> datevar StartDate;
> datevar EndDate;
> datevar array holiday;
> numbervar WD;
>
> holiday := [CDate(2007, 1, 01),CDate(2007, 4, 06),CDate(2007, 5,
> 28),CDate(2007, 7, 04),CDate(2007, 9, 03),CDate(2007, 11,
> 22),CDate(2007, 11, 23),CDate(2007, 12, 24),CDate(2007, 12, 25)];
> StartMonth:= Month(date({BAQReportParameter.Option01}));
> StartDate:= date(2007, StartMonth, 01);
> EndDate:=date({BAQReportParameter.Option01});
>
> intCount:= 0;
>
> While (StartDate <= EndDate) Do
> (
> //Make the above < and not <= to not count the EndDate
> if not(StartDate in holiday) then (
> Select WeekDay(StartDate)
> Case 1, 7:
> intCount:= intCount
> Case 2, 3, 4, 5, 6:
> intCount:= intCount + 1
> Default:
> intCount;
> );
> StartDate:= StartDate + 1;
> );
>
> WD:= intCount;
>
>
> ________________________________
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf
> Of Ken Williams
> Sent: Wednesday, November 28, 2007 12:01 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Crystal Reports networkdays?
>
>
>
> I'm having difficulty finding a function equivalent to Excel's
> NETWORKDAYS for Crystal Reports. Anyone know of one, or perhaps a
work
> around you may have used.
>
> Thanks,
> Ken
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
I'm having difficulty finding a function equivalent to Excel's
NETWORKDAYS for Crystal Reports. Anyone know of one, or perhaps a work
around you may have used.

Thanks,
Ken


[Non-text portions of this message have been removed]
Since I couldn't find a premade function, here's one I modified to work
with Crystal:

numbervar intCount;
numbervar StartMonth;
datevar StartDate;
datevar EndDate;
datevar array holiday;
numbervar WD;

holiday := [CDate(2007, 1, 01),CDate(2007, 4, 06),CDate(2007, 5,
28),CDate(2007, 7, 04),CDate(2007, 9, 03),CDate(2007, 11,
22),CDate(2007, 11, 23),CDate(2007, 12, 24),CDate(2007, 12, 25)];
StartMonth:= Month(date({BAQReportParameter.Option01}));
StartDate:= date(2007, StartMonth, 01);
EndDate:=date({BAQReportParameter.Option01});

intCount:= 0;

While (StartDate <= EndDate) Do
(
//Make the above < and not <= to not count the EndDate
if not(StartDate in holiday) then (
Select WeekDay(StartDate)
Case 1, 7:
intCount:= intCount
Case 2, 3, 4, 5, 6:
intCount:= intCount + 1
Default:
intCount;
);
StartDate:= StartDate + 1;
);

WD:= intCount;


________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Ken Williams
Sent: Wednesday, November 28, 2007 12:01 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Crystal Reports networkdays?



I'm having difficulty finding a function equivalent to Excel's
NETWORKDAYS for Crystal Reports. Anyone know of one, or perhaps a work
around you may have used.

Thanks,
Ken

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]