Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection and Non-Record Criteria Post Reply Post New Topic
Author Message
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Topic: Record Selection and Non-Record Criteria
     Posted: 05 Feb 2013 at 4:29am
Okay, so what I want is like this:
 
if month(CurrentDate) = 1 then
if {table.critieria} = "A"
then
True
Else
False
if( month(currentDate) = 2 then
if {table.critieria} = "B"
then
True
Else
False
 
 
So it always seems to not work, I assume because the variable I am using is not pulling from each record, but rather from the currentdate. In month one, I may want to look at records that match criteria A, but in month two, I want to look at records that meet Criteria B.
 
Is there any way to do this? This is for a report I intend to schedule via Crystal Enterprise so don't want to have to change it constantly as I could have dozens of these running very similarly but for different people.


Edited by Chase - 05 Feb 2013 at 4:30am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2013 at 5:34am
(month(table.datefield)=1 and table.criteria='A')
or
(month(table.datefield)=2 and table.criteria='B')
IP IP Logged
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Posted: 05 Feb 2013 at 6:03am
But I don't want to change it based on the value of the date of the record but on the current date.
 
If I run the same report on January, I want it to filter out not equal to A.
 
Then if the same report is reran in february, it switches to look for B.
 
Is this possible?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Feb 2013 at 6:34am

sorry, i thought you decided to look at the date field not today.

 
(month(currentdate)=1 and table.criteria='A')
or
(month(currentdate)=2 and table.criteria='B')
IP IP Logged
Chase
Newbie
Newbie


Joined: 28 Jan 2013
Online Status: Offline
Posts: 17
Quote Chase Replybullet Posted: 07 Feb 2013 at 10:24am
When I try this, crystal pulls in every record.
 
I am guessing it is because Month(currentdate)=2 is valid for every record.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Feb 2013 at 10:28am
yes. that is why i assumed you wanted to look at the month of the date field rather than today.
Not using any code, what are trying to accomplish?
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