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

total numbe of miles for carrier

Status
Not open for further replies.

rmcguire80

IS-IT--Management
May 31, 2012
106
US
I have a table Shipments with many records and for a shipment record can run my report which includes the field SHIPMENTS.TOTALMILES. There is also a field SHIPMENTS.CARRIERID on each record which represents the carrier who moved the shipment.

What Im trying to create is a formula to put on my report which would sum the field SHIPMENTS.TOTALMILES for the SHIPMENTS.CARRIERID for all records with that CARRIERID up to a certain date which is field, SHIPMENTS.ENTRYDATE on the record which Im running my report.

Any help would be appreciated. Is there a conditional summary which would accomplish this? I didn't think just a flat out summary would suffice


thanks
 
Group by SHIPMENTS.CARRIERID.

Create a formula field that is zero or the miles, depending. Something like
Code:
if SHIPMENTS.ENTRYDATE <= {your.date}
then SHIPMENTS.TOTALMILES
else 0

Get a total for @MilesThatCount. (If you're not already familiar with Crystal's automated totals, see FAQ767-6524.)

If you can't group by SHIPMENTS.CARRIERID, then you should be able to use it in a Crosstab.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11, 2008 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
also I should've mentioned this, the report is ran on an individual record, So I'll open for example shipment 501234 and run the report.

How can I use the formula for entrydate <= youredate Which would be the entry date on th record I'm on
 
If it's just one Shipment, you do just as I specified, but total for the whole report.

Entrydate is one of your fields, as far as I know.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
ok, I can get the sum of miles for all carriers to come up when I run it as its own individual report, but when I put that in as a subreport of my main report it only prints the miles for the shipment record Im running my main report on


Basically I have a report called Rate Confirmation and there is a carrier record tied to that confirmation, but those reports are sent out per record(shipment)

Im trying to add in the total number of miles for all shipments that the carrier assigned to that rate confirmation has been on.
 
If it is extra data, you'd need to pass shipping details and work from 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