TSCP74729404
Programmer
To begin I have a formula as follows that reads the dates in a list then outputs the leading Sunday Dates.
//@Randweek
WhileReadingRecords;
DateVar MyDate := Date({ProcedureName.RandDate});
//DayToStart value will be from 1 to 7. Sunday = 1,
Monday = 2,...Saturday = 7
NumberVar DayToStart := 1;
NumberVar DaysToSubtract;
//If MyDate is later 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
Then when I try to perform the following formula:
Count ({ProcedureName.RandNo},{@RandWeek})
I recieve the following:
"The summary/running total field could not be
created"
What I want this to do is to count all the records within the @RandWeek Sunday Dates.
Thanks
//@Randweek
WhileReadingRecords;
DateVar MyDate := Date({ProcedureName.RandDate});
//DayToStart value will be from 1 to 7. Sunday = 1,
Monday = 2,...Saturday = 7
NumberVar DayToStart := 1;
NumberVar DaysToSubtract;
//If MyDate is later 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
Then when I try to perform the following formula:
Count ({ProcedureName.RandNo},{@RandWeek})
I recieve the following:
"The summary/running total field could not be
created"
What I want this to do is to count all the records within the @RandWeek Sunday Dates.
Thanks