Hello,
I am using crystal 8.5 and created a crosstab. In my columns I have created a formula called week that starts the work week on a Saturday as opposed to default Sunday. Therefore my rows are showing the saturday(date) of each week within the date range. Although I have changed the start week, I now need to capture the Friday within this start week but still have the report know that the start week is from Saturday to Friday. Any way of doing this. All I need to see in the rows are dates that coincide to all Fridays within the date range without changing the data. If anybody can help me quickly this will be appreciated. I have attached the formula to help others who need this.
WhileReadingRecords;
DateTimeVar MyDate := {p_time_rpt_standard;1.Date};
NumberVar DayToStart := 2;
NumberVar DaysToSubtract;
//@custom-week
WhileReadingRecords;
DateTimeVar MyDate := {p_time_rpt_standard;1.Date};
//DayToStart value will be from 1 to 7. Sunday = 1, Monday = 2,...Saturday = 7
NumberVar DayToStart := 2;
NumberVar DaysToSubtract;
//If MyDate is earlier in the week then the DayToStart, then calculate DaysToSubtract as follows
If DayToStart > dayofweek(MyDate) then
DaysToSubtract:= 7 - DayToStart + dayofweek(MyDate)
//Else calculate DaysToSubtract as follows
Else
DaysToSubtract:= (dayofweek(MyDate) - DayToStart);
//MyDate - DaysToSubtract will return the previous Monday
MyDate - DaysToSubtract
I am using crystal 8.5 and created a crosstab. In my columns I have created a formula called week that starts the work week on a Saturday as opposed to default Sunday. Therefore my rows are showing the saturday(date) of each week within the date range. Although I have changed the start week, I now need to capture the Friday within this start week but still have the report know that the start week is from Saturday to Friday. Any way of doing this. All I need to see in the rows are dates that coincide to all Fridays within the date range without changing the data. If anybody can help me quickly this will be appreciated. I have attached the formula to help others who need this.
WhileReadingRecords;
DateTimeVar MyDate := {p_time_rpt_standard;1.Date};
NumberVar DayToStart := 2;
NumberVar DaysToSubtract;
//@custom-week
WhileReadingRecords;
DateTimeVar MyDate := {p_time_rpt_standard;1.Date};
//DayToStart value will be from 1 to 7. Sunday = 1, Monday = 2,...Saturday = 7
NumberVar DayToStart := 2;
NumberVar DaysToSubtract;
//If MyDate is earlier in the week then the DayToStart, then calculate DaysToSubtract as follows
If DayToStart > dayofweek(MyDate) then
DaysToSubtract:= 7 - DayToStart + dayofweek(MyDate)
//Else calculate DaysToSubtract as follows
Else
DaysToSubtract:= (dayofweek(MyDate) - DayToStart);
//MyDate - DaysToSubtract will return the previous Monday
MyDate - DaysToSubtract