Thursday, January 27, 2011

Previous and PreviousIsNull

Today I`v finished a long running development project and started testing the hidden corners, those little request of info that will bring the user bad info if any.
I`v entered an SQL where clause that I know will bring me two rows back with one ID only (same ID for both rows). From some reason I really don`t know why, the previous command suppressed both row and not only one of them. My basic logic is that only one will appear.
I guess I`m wrong :(

I`ve digged in the formulas and found the command PreviousIsNull and after several tests I got the the correct requested formula that will bring me the rows.
Here is the formula for your ref:
(NOT PreviousIsNull({TableFieldName}) AND {TableFieldName} = Previous({TableFieldName}))

With this formula I tell crystal report engine to suppress if both the previous record exists and is the same as the current one.

Hope this helped someone with this weird issue.


No comments:

Post a Comment