Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Returning the the date field from Post Reply Post New Topic
Author Message
grecianite
Newbie
Newbie


Joined: 28 Sep 2010
Online Status: Offline
Posts: 6
Quote grecianite Replybullet Topic: Returning the the date field from
    Posted: 19 Oct 2010 at 12:00am
In my details section, I have a formula which finds a specific type of price. This formula is
 
if {A_PRICES.PRICE_TYPE}="Bid" then {A_PRICES.PRICE} else 0
 
As there will be only one "Bid" price per day, this field is then summed in the Group Footer and then suppressed so as to show one price per day.
 
Below this in the Report Footer I have a Running Total which shows the highest price in the period and this works perfectly -BUT.....
 
.... in this Report Footer for the life of me I cannot return the actual date of this highest price (i.e. {A_PRICES.PRICEDATE}
 
 
In essence all I want is a new running total, based on a running total returning the date of the highest return.
 
Or
 
A running total returning a different return to what the running total is summing i.e. it calculate the highest price and then returns a date field instead.
 
 
 
 
 
To me, this all seems like it should be easy, but it's causing me pain and frustration!! Any help really would be most appreciated!
 
Thanks!!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Oct 2010 at 3:36am

here's what I do:

shared numbervar highBid;
shared datetimevar bidDate;
 
if {A_PRICES.PRICE_TYPE}="Bid" then(
  If {A_PRICES.PRICE} > highBid then(
    highBid := {A_PRICES.PRICE};
    bidDate := {A_PRICES.PRICEDATE};
  );
  {A_PRICES.PRICE}
else 0
 
 
then in the report footer, you can just create 2 formulas:
shared numbervar highBid
 
and
 
shared datetimevar bidDate
 
 
HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.