Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: If Else returns correct value but multiple records Post Reply Post New Topic
Page  of 2 Next >>
Author Message
RRushing
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 14
Quote RRushing Replybullet Topic: If Else returns correct value but multiple records
    Posted: 15 Feb 2011 at 3:58am
hello
 
We have user defined fields in an equipment table. They could be Alpha,  Date or Amt. We created a new Alpha field in the software program for equipment xref numbers.
 
I have a table with 6 fields that store the user defined info.
 
Company
Equipment
UserDefinedSequence
Alpha_Field
Date_Field
Amount_Field
 
The field called "UserDefinedSequence" stores an ID number for the users defined fields. "Alpha_Field" holds the  xref number we are trying to get.
 
Right now we are using 2 user defined Alpha fields in the software so there is 2 codes in the UserDefinedSequence field (000018 and 000070).
 
The info is stored in the Alpha_Field.
 
When I run the report for Equipement # 1000... I get
 
EQ#        Seq#        XREF#
 
1000       000018
1000       000070    3056
 
Here is my formula:
 
whileprintingrecords;
iif ({EC_EQP_USER_DEF_FLDS_MC.User_Def_Sequence}="000070",{EC_EQP_USER_DEF_FLDS_MC.Alpha_Field},"")
 
I need the formula to return just on row showing a xref # if it has one or not.
 
thanks
 
Rick
 
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2011 at 4:18am

I am confudes by the design.

why not just use the select expert with
{EC_EQP_USER_DEF_FLDS_MC.User_Def_Sequence}="000070"
?
 
IP IP Logged
RRushing
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 14
Quote RRushing Replybullet Posted: 15 Feb 2011 at 4:22am
hey DB
 
when I do all I get are those records with a XREF#. I need to see if it is blank also, not having a XREF#.
 
 
Rick
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2011 at 4:25am
(isnull({EC_EQP_USER_DEF_FLDS_MC.Alpha_Field}) or
{EC_EQP_USER_DEF_FLDS_MC.Alpha_Field}="")
and
{EC_EQP_USER_DEF_FLDS_MC.User_Def_Sequence}="000070"
 
 
IP IP Logged
RRushing
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 14
Quote RRushing Replybullet Posted: 15 Feb 2011 at 4:56am
Hey DB
 
 
is this 2 options?
 
does the formula go into a field or go into Select Expert?
 
 
 
thanks
 
Rick
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2011 at 4:59am
this is one statement that goes into the select expert to select
any NULL or blank alpha fields where the sequence field = 000070
IP IP Logged
RRushing
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 14
Quote RRushing Replybullet Posted: 15 Feb 2011 at 5:19am
DB
 
in select expert which field does this formula apply to? Userdef or Alpha field?
 
Also when I did this formula, the Record select split it into to entries.
 
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2011 at 5:24am

the formula is apply criteria to 2 fields indicate in the red and blue.

(isnull({EC_EQP_USER_DEF_FLDS_MC.Alpha_Field}) or
{EC_EQP_USER_DEF_FLDS_MC.Alpha_Field}="")
and
{EC_EQP_USER_DEF_FLDS_MC.User_Def_Sequence}="000070"
 
Not sure what you mean it split it into 2...
open the select expert
click on the show formula
click on the formula editor
add the formula there
 


Edited by DBlank - 15 Feb 2011 at 5:24am
IP IP Logged
RRushing
Newbie
Newbie
Avatar

Joined: 10 Jan 2011
Location: United States
Online Status: Offline
Posts: 14
Quote RRushing Replybullet Posted: 15 Feb 2011 at 5:31am
Hey DB
 
I get no results.
 
 
Rick
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2011 at 5:33am
are you using any other select criteria?
 
IP IP Logged
Page  of 2 Next >>
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.