Hi,
I tried to create a check for holidays in my report (CR V12).
In my main report I use the database: MainGroup.ArrivalTime [type is 'Date Time']
In another database (type is 'STRING') the holiday days are specified;
HolidayHours.ID HolidayHours.HolidayDate
1 2009-04-13
2 2009-05-21
3 2009-06-01
4 01-01
5 12-25
6 12-26
I would like to build a check like; IF MainGroup.ArrivalTime IN HolidayHours.HolidayDate THEN ..
I've created a subreport to fill up an array named "Holidays", but all values are 'TRUE'.
Problem is HolidayHours.HolidayDate should be converted to a correct date (with for this year all 'years = 2009').
// subreport
local numbervar countholidaydays;
countholidaydays = Maximum({HolidayHours.ID}); // result = 6 = correct
Shared DateVar Array holidays;
Redim holidays[countholidaydays];
Local numbervar i;
For i := 1 To countholidaydays Do
( if Datepart("yyyy",cdate({HolidayHours.HolidayDate})) <> 0
then holidays = cdate({HolidayHours.HolidayDate})
else holidays = cdate(DateAdd("yyyy", Datepart("yyyy", CurrentDate),cdate({HolidayHours.HolidayDate})));
)
Tips "How to fill an array 'Holidays' with the following data" are welcome;
2009-04-13
2009-05-21
2009-06-01
2009-01-01
2009-12-25
2009-12-26
And how can I use the created 'Date' array to check "IF MainGroup.ArrivalTime IN Holidays THEN .."
Thanks
I tried to create a check for holidays in my report (CR V12).
In my main report I use the database: MainGroup.ArrivalTime [type is 'Date Time']
In another database (type is 'STRING') the holiday days are specified;
HolidayHours.ID HolidayHours.HolidayDate
1 2009-04-13
2 2009-05-21
3 2009-06-01
4 01-01
5 12-25
6 12-26
I would like to build a check like; IF MainGroup.ArrivalTime IN HolidayHours.HolidayDate THEN ..
I've created a subreport to fill up an array named "Holidays", but all values are 'TRUE'.
Problem is HolidayHours.HolidayDate should be converted to a correct date (with for this year all 'years = 2009').
// subreport
local numbervar countholidaydays;
countholidaydays = Maximum({HolidayHours.ID}); // result = 6 = correct
Shared DateVar Array holidays;
Redim holidays[countholidaydays];
Local numbervar i;
For i := 1 To countholidaydays Do
( if Datepart("yyyy",cdate({HolidayHours.HolidayDate})) <> 0
then holidays = cdate({HolidayHours.HolidayDate})
else holidays = cdate(DateAdd("yyyy", Datepart("yyyy", CurrentDate),cdate({HolidayHours.HolidayDate})));
)
Tips "How to fill an array 'Holidays' with the following data" are welcome;
2009-04-13
2009-05-21
2009-06-01
2009-01-01
2009-12-25
2009-12-26
And how can I use the created 'Date' array to check "IF MainGroup.ArrivalTime IN Holidays THEN .."
Thanks