Hi,
I need create a crystal report to show the most recent date when people’s status becomes negative.
In a time period, for example, from March 1 to today, a person’s status became -1 in March 10, and then became positive on May 2, but on May 20, it became -1 again. Now it is -1. I need display the May 20 data in my report. I tried to select all the people with -1 status, and group them by person’s ID, then insert a minimum date. But what I got is March 10. But since after May 2, the status became positive, so March 10 is not what I need. How can my report have May 20 selected, which is the most recent date the status became -1?
If I do it in Java, I can do a loop starting from most current date to pick the 05-20-09 record out. But how can I do it in Crystal Report?
Example:
ID Status Entry_Date
111 0 03-09-09
111 -1 03-10-09 --- not this one
111 -1 03-12-09
111 -1 04-02-09
111 0 05-02-09
111 0 05-08-09
111 -1 05-20-09 --- I need this record in my report
111 -1 06-01-09
111 -1 06-09-09
I hope I explain my question clear.
Thanks a lot for any helps, suggestions!!!!!
I need create a crystal report to show the most recent date when people’s status becomes negative.
In a time period, for example, from March 1 to today, a person’s status became -1 in March 10, and then became positive on May 2, but on May 20, it became -1 again. Now it is -1. I need display the May 20 data in my report. I tried to select all the people with -1 status, and group them by person’s ID, then insert a minimum date. But what I got is March 10. But since after May 2, the status became positive, so March 10 is not what I need. How can my report have May 20 selected, which is the most recent date the status became -1?
If I do it in Java, I can do a loop starting from most current date to pick the 05-20-09 record out. But how can I do it in Crystal Report?
Example:
ID Status Entry_Date
111 0 03-09-09
111 -1 03-10-09 --- not this one
111 -1 03-12-09
111 -1 04-02-09
111 0 05-02-09
111 0 05-08-09
111 -1 05-20-09 --- I need this record in my report
111 -1 06-01-09
111 -1 06-09-09
I hope I explain my question clear.
Thanks a lot for any helps, suggestions!!!!!