Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Editor Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Feb 2009 at 1:04pm
No problem just letting you know I was trying to waste your time and energy by giving you extra work Confused.
Let's focus on the the second option.
FIrst let's validate the formula
if datediff("d",currentdate,{CDS_STATDAY.GamingDate})<180 then {CDS_STATDAY.TWin} else 0
Place it on a detail row and make sure it is doing what it should. FOr any record where the date is in the last 179 days (<180) it should put in the value from {CDS_STATDAY.GamingDate}). For anything else it should put in a 0.
IF that is happening correctly check your summary function field that should be placed on the group header1 or groupfooter1.
it should look something like
SUM(@Last180only, group1table.field)
 
Let me know where it stands from there.
IP IP Logged
billbjr
Newbie
Newbie


Joined: 19 Feb 2009
Location: United States
Online Status: Offline
Posts: 14
Quote billbjr Replybullet Posted: 27 Feb 2009 at 1:31pm
I'm using the formula you posted above exactly and it's still returning a TWin value for each date record, even for records from a year ago. Here's a copy/paste from the formula editor:
 
if datediff("d",currentdate,{CDS_STATDAY.GamingDate})<180 then {CDS_STATDAY.TWin} else 0
 
sorry this is such a pain. i'm learning a lot though...
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Feb 2009 at 1:43pm

Arrg, My fault. I was not paying attention. Reverse the dates in the formula. The formula was giving you negative numbers for everything and therefore they are all <180....

 
if datediff("d",{CDS_STATDAY.GamingDate},currentdate)<180 then {CDS_STATDAY.TWin} else 0
IP IP Logged
billbjr
Newbie
Newbie


Joined: 19 Feb 2009
Location: United States
Online Status: Offline
Posts: 14
Quote billbjr Replybullet Posted: 27 Feb 2009 at 2:00pm
eureka!!!
 
Thanks man. I appreciate it. Look forward to working with you again in the future. Great job!!!
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Feb 2009 at 2:02pm
No problem. Sorry for the extra work.
Note that if you fixed the formula to reverse the dates in the running total that should also give you the correct data as well now (from option 1 in the previous post).
IP IP Logged
<< Prev  Page  of 2
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