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

Showing only the last entry

Status
Not open for further replies.

sjc1956

Technical User
Jan 14, 2004
19
This is a subreport that is showing entries in a patient's chart. I want only the last entry which is a text_parm determined by the last entry time.

{c_text_parm.emtek_id} = {?Pm r_adt_core.emtek_id} and
isnull ({c_text_parm.changed_date}) and
{c_text_parm.object_name} like 'C_NEWGU3' and
not ({c_text_parm.text_value} like ['Tol*','Cath','has*','*clamped*']) and
{c_text_parm.time_for} > (CurrentDateTime -1.0)
 
What version of CR?

Presumably you want all of this criteria in the record selection formula, and you also want the row(s) with the most recent date.

Start formulas with the isnull, Crystal may ignore it otherwise:

isnull ({c_text_parm.changed_date})
and
{c_text_parm.emtek_id} = {?Pm r_adt_core.emtek_id}
and
{c_text_parm.object_name} like 'C_NEWGU3'
and
not ({c_text_parm.text_value} like ['Tol*','Cath','has*','*clamped*'])
and
{c_text_parm.time_for} > (CurrentDateTime -1.0)

I'm not sure why you want that last date check, a date might be less than yesterday and still be the largest.

The get the row with the largest date, add something akin to:

{c_text_parm.time_for} = maximum({c_text_parm.time_for})

or use whichever date field you need. Rather than trying to describe requirements with text, try using example data and expected output. Your text references "the last entry which is a text_parm determined by the last entry time", but doesn't state which date field is that entry time, which example data and expected output would have made clear.

-k
 
Thanks for your response. I tried
{c_text_parm.time_for} = maximum({c_text_parm.time_for}) and I get an error that says "This function cannot be used because it must be evaluated later"
Entry time can either be c_text_parm.entered_at or c_text_parm.time for. Each chart will vary. Everyone enters data at different times.
Either way it still throws me that same error.
 
Where did you try to place this formula?

It should be in Report->Edit Selection Formula->Group

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top