More info. OK here we go. ohw, BTW I use CR 10.
What I have is four fields.
1) a Clientnumber ({TBLKLANT.KLAID})
2) a startdate ({TBLSELECTIE.SEEAFNAMEDATUM})
3) a text field (not in function)
4) a number field ({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD})(1 means that something has changed in the DB after insert).
The data is orderded on Clientnumber then the startdate. The date should be between to other dates (in {?Begindatum} to {?Einddatum}).
1 1-1-2005 "Text1" 1
1 1-1-2005 "Text1" 0
1 1-2-2005 "Text2" 0
1 1-3-2005 "Text3" 1
1 1-4-2005 "Text4" 0
1 1-5-2005 "Text5" 0
2 1-5-2005 "Text6" 0
2 1-6-2005 "Text7" 0
2 1-7-2005 "Text8" 1
3 1-8-2005 "Text9" 0
I have no groups.
What I want is the following.
1) Show the row where number is 1 if the next row is same client.
2) show the row after the row where the number is 1 if the client is same client.
3) Show the row before the row where number is 1 if the next client is same client but also !!where te next next client is same client!! (The part between !! is the part missing in my formula.)
(for al three also a date is in is used, but that is not the problem here)
So my result should be:
1 1-1-2005 "Text1" 1 (rule 1)
1 1-1-2005 "Text1" 0 (rule 2)
1 1-2-2005 "Text2" 0 (rule 3)
1 1-3-2005 "Text3" 1 (rule 1)
1 1-4-2005 "Text4" 0 (rule 2)
See below for the complete code I have so far. There is 1 problem with the code and that is in this part:
OR
Next ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID}
AND Next({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}) = 1
AND Next({TBLSELECTIE.SEEAFNAMEDATUM}) in {?Begindatum} to {?Einddatum}
What I need here is a check to see if the next,next record is also of the same client cause if I do not check this I will also get to see the row
2 1-5-2005 "Text7" 0
Any idea's how to do this? (Hopes this clarifies anthing

)
Thanx in advance,
B.
PS
I have come up with the following code:
NOT
(
If NOT PreviousIsNull ({TBLKLANT.KLAID}) AND NOT NextIsNull ({TBLKLANT.KLAID}) then
(
(
(
{TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}=1
AND Next ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID}
AND {TBLSELECTIE.SEEAFNAMEDATUM} in {?Begindatum} to {?Einddatum}
)
OR
(
Previous ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID}
AND Previous({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}) =1
AND Previous({TBLSELECTIE.SEEAFNAMEDATUM}) in {?Begindatum} to {?Einddatum}
)
OR
Next ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID}
AND Next({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}) = 1
AND Next({TBLSELECTIE.SEEAFNAMEDATUM}) in {?Begindatum} to {?Einddatum}
)
)
else if PreviousIsNull ({TBLKLANT.KLAID}) then
(
Next ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID} AND Next({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}) =1 AND Next({TBLSELECTIE.SEEAFNAMEDATUM}) in {?Begindatum} to {?Einddatum}
)
else if NextIsNull({TBLKLANT.KLAID}) then
(
Previous ({TBLKLANT.KLAID}) = {TBLKLANT.KLAID} AND Previous({TBLUITSLAGSELECTIE.SELKLANTUITGESTROOMD}) =1 AND Previous({TBLSELECTIE.SEEAFNAMEDATUM}) in {?Begindatum} to {?Einddatum}
)
)