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

Most recent date needed

Status
Not open for further replies.

stcholly

Technical User
May 17, 2006
25
US
NEWBIE - Crystal 10, Timberline 9.2

I have this very basic formula to look up the amount for "Percent Complete". However, this may have more than one value, so I need to pick the value that has the most recent transaction date, but I'm not sure how to word it.

if {CURRENT_JCT_TRANSACTION.Transaction_Type} = "Percent complete"
then {CURRENT_JCT_TRANSACTION.Amount}

Thanks,
H
 
Try the following:

Group the data by Transaction_type
and then change your above formuala in record selection
as
if {CURRENT_JCT_TRANSACTION.Transaction_Type} = "Percent complete"
then Max({CURRENT_JCT_TRANSACTION.Amount},CURRENT_JCT_TRANSACTION.Transaction_Type})

Hope this helps!

 
This pulls in the maximum percentage, but not the entry for the most recent date/time.

For example, I have a "Percent Complete" entered on 12/31/06 as 100% at 13:42, and then this was reduced to 0% on 12/31/06 at 14:27. I need to most recent entry pulled in, which in this case would be the 0%. Using the above MAX formula, it pulls the MAXIMUM percentage (or 100%).

 
You first need to group, on some value like account number. Insert > Group and choose a field. Note that it has to be some property of an individual 'row', a detail line derived from a single record, or from several individual records from different tables (datasets).
You can then move the record details to group header or footer, and suppress the detail line. (Right-click on the section and choose Format Section.)

Use Report > Record Sort Expert to put them into a particular order, transaction date. It can be ascending or descending, meaning you need to use the group header or footer.

Use your existing calculation, but put it there.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top