Break by

Hi everyone,

i have a little problem and I can't figure it out, maybe you can help me.

in my table I have following records
Art Clr Type Date Time Value
100 25 A 1/1/08 10:30 8
100 25 A 1/1/08 10:25 9
100 30 A 1/1/08 10:29 5
100 30 A 1/1/08 10:21 6

i need following the last modified record for art / clr / type, so the result must be:
100 25 A 1/1/08 10:30 8
100 30 A 1/1/08 10:29 5

thx in advance
 

MrMoo

Member
Hi Kenny,

I think you could get the results you're looking for with the following:

for each table Break By Art By Clr By Type By Date Desc By Time Desc

if first-of(Art) then
if first-of(Clr) then
if first-of(Type) then
Display Art Clr Type Date Time Value.

This should work for what you need. There are probably better ways to do it but it's just what I slapped together You could remove the DESC from Date and Time and take the last of type if you like as well.
 

tamhas

ProgressTalk.com Sponsor
I think you will find that first-of(third level break) is equivalent to listing all three as you have done. Been a while, but that is my memory.
 

MrMoo

Member
You're right, I just tested it and it returns the same results. I knew there were probably better, cleaner ways of doing it I just created something that I knew would work and didn't spend anytime trying to improve it.

So Kenny like Tamhas said it should be the following:

for each table Break By Art By Clr By Type By Date Desc By Time Desc

if first-of(Type) then
Display Art Clr Type Date Time Value.
 
Top