atgrovecity
Programmer
Hello Crystal Experts,
Here is my puzzle:
I need to create a hospital report of client movements, but the report must only display the first record, that is the earliest movement date, of the client's latest Unit location. The records are sorted by client ID and movement date with movement date in descending order. Movement records are generated when the client switches Unit locations or when staying in the same Unit location due to bed changes or leave events etc. I need to figure how to code a Flag field to handle this. Below is a sample display of the data with the flag field set to 1 for the records I want to display and the flag field set to 0 for the records I want to suppress.
Client Unit Movement Date Flag
111222 G 03/11/2013 0
111222 G 03/10/2013 0
111222 G 02/25/2012 0
111222 G 07/14/2010 1
111222 A 02/08/2006 0
111222 A 02/07/2006 0
111222 H 01/02/2005 0
111222 G 02/01/2004 0
333142 F 01/22/2014 0
333142 F 01/21/2014 0
333142 F 10/23/2013 1
431222 H 11/28/2013 1
521333 I 04/07/2013 0
521333 I 03/14/2013 1
521333 H 11/27/2012 0
Appreciate any help on coding the Flag field.
Sincerely,
Joe
Here is my puzzle:
I need to create a hospital report of client movements, but the report must only display the first record, that is the earliest movement date, of the client's latest Unit location. The records are sorted by client ID and movement date with movement date in descending order. Movement records are generated when the client switches Unit locations or when staying in the same Unit location due to bed changes or leave events etc. I need to figure how to code a Flag field to handle this. Below is a sample display of the data with the flag field set to 1 for the records I want to display and the flag field set to 0 for the records I want to suppress.
Client Unit Movement Date Flag
111222 G 03/11/2013 0
111222 G 03/10/2013 0
111222 G 02/25/2012 0
111222 G 07/14/2010 1
111222 A 02/08/2006 0
111222 A 02/07/2006 0
111222 H 01/02/2005 0
111222 G 02/01/2004 0
333142 F 01/22/2014 0
333142 F 01/21/2014 0
333142 F 10/23/2013 1
431222 H 11/28/2013 1
521333 I 04/07/2013 0
521333 I 03/14/2013 1
521333 H 11/27/2012 0
Appreciate any help on coding the Flag field.
Sincerely,
Joe