grouping on interval

acepayne

Registered User.
Local time
Today, 19:14
Joined
Jul 26, 2001
Messages
44
Good morning,

I would like to place a line after groups of records based on a value in the record. For example:

Record 1 1.05
Record 2 5.77
Record 3 9.87
---------------
Record 4 10.50
Record 5 17.66
---------------
Record 6 23.00
---------------
Record 7 36.99
Record 8 38.99
---------------

and so on.

All of the records with a value of 0-9.99 are nicely grouped together, all of the records with a value of 10-19.99 are grouped together, etc., with a line indicating this.

This is easy enough. I've grouped by the field with the value, placed a line in the group footer section for the group, and gave it an interval of 10.

Now, here comes the dicey part. When the value goes over 100, I would like to be able to change the interval from 10 to 100! So, while the value is less than 100, group by interval 10, but after that group by interval 100. I hope that makes sense.

Is this possible? Or if there is a way to do this, I would love to hear how!

Thanks in advance!

Cheers,
Ace
 
Try grouping on this expression:
Int([Value]/10^(Len(Trim([Value]))-1))*10^(Len(Trim([Value]))-1)

(replace [Value] with the actual field name you wish to enumerate)
 
ByteMyzer said:
Try grouping on this expression:
Int([Value]/10^(Len(Trim([Value]))-1))*10^(Len(Trim([Value]))-1)

(replace [Value] with the actual field name you wish to enumerate)

Hey, thanks for this! Almost perfect, I just had to add another Int() function inside each side of the equation (it was only working on numbers like 32.00 and 117.00, not 32.22 or anything with values to the right of the decimal. For example, 117.26 would return a 0).

Anyway, works great!!

Thanks so much.

Cheers,
Ace
 

Users who are viewing this thread

Back
Top Bottom