What makes it the "last" entry in the detail section? Is there a date field? Some other field that is sequential? How are records being sorted--on what field?
Hi,
I have a list of sequential numbers detailing stock checks over a date range. I need to capture the last stock check entry and then display that number in the group heading.
This group is sorted by product ID/Decsription.
What field are you grouping on? If you are able to sort on the sequential number field in descending order, you can then just place the check entry in the group header and the most recent one will be displayed.
You could either save the report under a different name and then insert it as a subreport into the group header (linked on the groupheader), and with a group selection formula in the sub:
You said you had a sequential number per record, but didn't show it.
Another method would be to create a SQL expression {%maxno} like this:
(
select max(`sequentialno`)
from table A
where A.`groupfield` = table.`groupfield`
)
...although you might have to build in selection criteria to match your main report if there can be sequential numbers later than those returned by your report date range.
Then you could create a formula like this:
if {table.sequentialno} = {%maxno} then
totext({table.noitems},0,"")+" "+totext({table.currencyamt},0,"")
Place this in the detail section and insert a maximum on it at the group level, and then drag the result into the group header.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.