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!

Having trouble with selecting the last instance of a certain record

Status
Not open for further replies.

SSSFisgard

Technical User
Nov 7, 2006
27
Hi guys,

I'm needing a little help. CRXI R2 user, on a sql database. I have a table with a number of transactions and transaction codes. I need to just display the lastest record with the certain transction code. I'll show an example.

Row Trans date Code Amount
5 18-sep-07 adv 100,000
6 18-sep-o7 int 5,000
7 19-sep-07 adv 100,000
8 20-sep-07 int 5,000




I need to just display Row 7 and all its "parts". Date, amount, code ect.

If someone could help me out that would be awesome.

SS
 
Create a formula {@lastadv}:

if {table.code} = "adv" then {table.transactiondate}

Assuming you want the most record with code "adv" per some group, you would then go to report->selection formula->GROUP and enter:

{table.transactiondate} = maximum({@lastadv},{table.groupfield})

-LB
 
Wow you're good.

Thanks a lot for the help lbass. Made my life easier.

SS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top