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

How to Display Previous Field on Report

Status
Not open for further replies.

KARMENDRA

Programmer
Jan 22, 2004
9
US
Hi!I'm using Crystal 9.0,Data Access .DAT File with Dataflex connectivity.My Data is like this

ID Date Status
1 01/01/04 D
1 01/03/04 E
1 01/04/04 F
2 01/01/04 P
2 01/02/04 Q
3 01/01/04 S

I wanted to dispaly Previus staus like this
ID DATE STATUS
1 01/01/04
1 01/03/04 D(Previous)
1 01/04/04 E(Previous)
2 01/01/04 (No Previous Record So It should be blank)
2 01/01/04 P
3 01/01/04 S
(I used Previous(Status) but it gave me previous record of other unit id)
If Selection Criteria is by Date it should display only 01/01/04 data but with Previous Status.I cannot write Store Procedure or SQL Statement for this.
What I did:Create Main Report-Sub Report-Shared Variable from Main to Sub to get Previous Staus.But by some reason didnot work.I'm still thinking that there may be other way to do it.Any Idea???
Thanks
 
Use something like:
--------------------------------------------------------
IF OnFirstRecord OR Previous({ID}) <> {ID} THEN &quot;&quot; ELSE Previous({Status})
--------------------------------------------------------

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Sorry for late response.It won't work because If i select parameter to run this report for 010304 it will generate blank for unit id 01 date 010304.
I want if select date parameter is 01/03/04 it should
generate report like this
1 01/03/04 D(Previous status of last visited record).

 
You cannot get the previous value without the previous record being selected for inclusion in the report. You could include all records and then use a suppression formula (as in your other post) to suppress details outside of the parameter range. This would allow you to still access the value of a previous field for display, and Ido's formula should then meet your needs.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top