Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help with the following message...

Status
Not open for further replies.

TSCP74729404

Programmer
Feb 14, 2005
4
US
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
 
What does " that reads the dates in a list" mean, that you have fields/columns in a table, or is there some list involved?

If you just want the number of {ProcedureName.RandNo} for a given date range, group by the date and select for each week and use a formula such as:

Count({ProcedureName.RandNo},{ProcedureName.RandDate})

Or you might want a distinct count.

-k

 
Oops, should be:

Count({ProcedureName.RandNo},{ProcedureName.RandDate},"weekly")

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top