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

Next to last record?

Status
Not open for further replies.

Tarphon

Technical User
Jul 10, 2012
1
US
Hello, I am a CR newby so be nice. Crystal Reports 8.5

I am attempting to pull the next to last record in a field. The field automatically clears when the last item is sold so the maximum will be null when we are out.

I have tried

if isnull({INVENTORY.INVENTORY_LOCATION})then previous({INVENTORY.INVENTORY_LOCATION})

I also tried

if onlastrecord then previous({INVENTORY.INVENTORY_LOCATION})

Thank you in advance for any and all assistance. :)
 
Several ways. Including excluding items with isnull({INVENTORY.INVENTORY_LOCATION}), if you don't need them for something else.

Another method is to have a summary total and a running total. The summary count looks at the data and would be 10 instantly in a group of 10, you could show it as that in the header. A running total runs along with the printing, so it is 0 in the header, 1 for the first record and so on.

Meaning that the running total is one less than the summary total for the last but one record, you could select on that.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top