Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula to count records with dates in a range Post Reply Post New Topic
Author Message
ChzHdGrrl
Newbie
Newbie
Avatar

Joined: 07 Mar 2012
Online Status: Offline
Posts: 10
Quote ChzHdGrrl Replybullet Topic: Formula to count records with dates in a range
     Posted: 15 Nov 2012 at 9:08am

I need the ability to count the number of records where a date falls within the most recent quarter. For example, if a record has a date of 8/15/2012, I need to count it, but if it has a date of 5/15/2012, it should be excluded. I'll be using an IF THEN ELSE to assign a binary I'll use to count.

 
Any ideas? I've been stumped on this for several days.
 
:)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Nov 2012 at 9:34am

you can use a formula to set 1 and 0 if you have no duplicate records

if datepart('yyyy',currentdate)=datepart('yyyy',table.date) and datepart('q',currentdate)=datepart('q',table.date) then 1
 
Sum this formual field
 
or you can use running total with an evlauate formula
or you can use variable formula


Edited by DBlank - 15 Nov 2012 at 9:34am
IP IP Logged
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