Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

Re: Need to pull first order placed based on ordering datetime

$
0
0

Ok, you'll need a couple of variables and a couple of formulas to do this.

 

{@TimeDifference}

NumberVar ddiff;

 

If OnFirstRecord then

  ddiff := DateDiff("n",{ORDER_PROC.ORDER_TIME},{ED_IEV_EVENT_INFO.EVENT_TIME})

else

  ddiff := ddiff + DateDiff("n",{ORDER_PROC.ORDER_TIME},{ED_IEV_EVENT_INFO.EVENT_TIME});

 

Put this formula in the Group Header.  With the semi-colon on the end, it won't display anything.

 

{@OrderCount}

NumberVar ordCount;

if OnFirstRecord then

  ordCount := 1

else

  ordCount := ordCount + 1;

 

Put this formula in the group header as well.  With the semi-colon on the end, it won't display anything.

 

{@AvgTimeDiff}

NumberVar ddiff;

NumberVar ordCount;

if ordCount > 0 then

  ddiff / ordCount

else

  0

 

Put this in the report footer - there is no semi-colon on the end so it will display the average value.

 

-Dell


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>