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

Trouble with first/last records

Status
Not open for further replies.

JCiesielski

Programmer
Jan 4, 2005
5
US
I'm using Crystal 8.5,
I have a report that lists technical data for a given day's production (we produce steel coils), each record includes the coil's number, gauge, weight etc. I recently got a request for the first and last coil's numbers to show up in the report header. The coil numbers are strings, and are in the format '910-00000'. I've tried using summary fields, but no matter what I try, I always seem to get just the information for a single page. Any ideas would be greatly appreciated
 
You could try removing the hyphen and return the value of the result in a formula:

val(replace({table.coil_num},"-",""))

You could then insert a minimum summary and a maximum summary based on the above formula, and move them from the report footer to the report header.

~Brian
 
A shame you didn't bother to state your database type, this seems like a prime candidate for a SQL Expression, which should prove the fastest.

An alternative is to use a formula to show them:

left(totext(minimum(val(replace({table.coil_num},"-",""))),0,""),3)
+"-"+
mid(totext(minimum(val(replace({table.coil_num},"-",""))),0,""),4)

For the other value replace minimum with maximum.

Might be a syntax error in there as I can't test right now.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top