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

Select YTD and Summarize Monthly weekly daily

Status
Not open for further replies.

Jcfx

MIS
Oct 8, 2004
134
US
CR10 on Sql DB.

Folks helped me out before with a time zone formula earlier on this base report. The following is a derivative.

Detail Fields are:
Ord_hdrnumber <Order>
Stp_arrivaldate <Actual Arrival>
Stp_schdtlatest <Latest Allowed Arrival>
@Late
Code:
numbervar tsecs := datediff("s",{RptServiceByRegion;1.stp_schdtlatest},{RptServiceByRegion;1.stp_arrivaldate});
numbervar ndays := truncate(tsecs/86400);
tsecs := remainder(tsecs,86400); 
numbervar nhours := truncate(tsecs/3600); 
tsecs := remainder(tsecs,3600);
numbervar nmin := truncate(tsecs/60); 
tsecs := remainder(tsecs,60);
if nhours-24<=0 then totext(ndays,0)+"D: "+totext(nhours,0)+"H: "+ totext(nmin,0)+
"M:

Two groups.
Group one is based on whether it was a pickup or Delivery {@grouptitle}
Group two is what Region the pick up or delivery is made in, and is based on a field in the order.

I have a two running totals that count when the loads are late and these are in the group footers, I also have two percentage formulas based off of those running totals to show what percent of the loads are late.
Code:
 (((({#RTotal0}/DistinctCount ({RptServiceByRegion;1.ord_hdrnumber},{@GroupTitle}))*100)-100)*-1)

The selection criteria for the report is {stp_arrivaldate}in YearToDate.

The finishing touches for this report is to have a Monthly and daily breakdown of the percentages at the region level, <and I wouldn’t be surprised to have them ask for weekly too>. My head wants to make this more complicated then I think it is. Would it be better to insert two<or three> more groups, for month/week/day and have running totals/summaries at that level. Or can I take the information I already have and pull it into some other formulas that break it out by month/date/week based on the stp_arrivaldate?.

Final results requested:

Code:
Region A
	Deliveries
		Order  ActualArrival  LatestArrival  Late Driver
		Detail  Detail               Detail             Detail Detail
	<Late order counts and percentages based on Year/Month/week/day>

	Pickups
		Order  ActualArrival  LatestArrival  Late Driver
		Detail  Detail               Detail             Detail Detail
	<Late order counts and percentages based on Year/Month/week/day>
Region B
	Rinse and repeat

Like I said I have a tendency to take something that is probably very simple and make it very complicated :(
Appreciate any assistance.


Julie
CR 9,10 CE10 Sql DB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top