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

Error with grouping

Status
Not open for further replies.

LW00

Programmer
Joined
Sep 28, 2008
Messages
4
Location
HK
Hi,

I was having a problem with the sum formula in my report. There are two groups in my report, h.locationname and h.hdateTime.

My formula has an if statement with the condition like so:

if Sum ({@OCount}, {h.htddatetime}) <> 0 then

When I try to save the formula CR 12 gives me an error: 'There must be a group that matches this field'. I believe CR is saying I do not have a grouping on h.htddatetime (a date type field). So I thought I might have done a grouping wrong. So I tried with h.locationname (string) like such:

if Sum ({@OCount}, {h.locationname}) <> 0 then

CR gave me no errors. I have created groupings for htddatetime and locationname the same way, that is through the group expert with no fancy formula groupings.

I am extremely puzzled and would appreciate anyone with even the faintest idea as to why CR gives me this error.

LW . . . Lawrence
 
I don't know if this was just a typo, but you said you have a group on h.hdatetime and you're formula is looking for group h.hdtdatetime - not the same field.
 
lol. Yeah that was just a typo. I actually go the problem resolved. I neglected to include a 3rd parameter in my code which said 'by seconds'. So to fix the problem I needed to right click on the htddatetime group and select 'change group'. Then at the bottom of the dialog box where it says 'this section will be printed', i had to select 'for each second'. Case closed! You learn something new every day . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top