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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERROR: "There must be a group that matches this field"

Status
Not open for further replies.

pokerace

Technical User
May 24, 2005
118
US
I created a formula that is giving me the error "There must be a group that matches this field." Here is the formula, but I can't figure out what the problem is or why a group would need to match the field. The Present Hours formula exists and seems to be ok.

whileprintingrecords;

global numbervar Daycounter;

if sum({@Present Hours},{DATE}) >= 0
then (Daycounter := Daycounter + 1;)

else Daycounter := Daycounter;
 
There must be a group on the report based on the {DATE} field that you referenced. Also, if it is a true date type, there must be a 3rd argument that defines how the dates are being grouped.
eg
Sum({@Present Hours} , {YourTable.YourDate, 'daily'})

would give you the sum of {@Present Hours} for each day, assuming that you chose Day when you created the group.



Bob Suruncle
 
If I add a group for the formula field and/or the database date field it still gives me the same error.
 
The group MUST be on the date field. If want the date group to be per day, make sure it is set to print on change of day (I think it defaults to on change of week in CR 11). To check this, go to report->group expert->options. Also, if you are using a group based on day, you don't need the condition "daily", as this is the default condition for a date group formula. It doesn't hurt to include the condition, but Bob's example contained an inadvertent error which might have thrown you--it should have been:

Sum({@Present Hours} , {YourTable.YourDate}, 'daily')

You should also verify that your date field is a date datatype, as Bob also suggested. If you roll your mouse over the date field on your report, it will tell you the datatype.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top