Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula Creation Post Reply Post New Topic
Author Message
dthmtlgod
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 1
Quote dthmtlgod Replybullet Topic: Formula Creation
     Posted: 08 Apr 2011 at 1:09am
I have two data sources that joined with a Left Join.
 
I am trying to check criteria in one and pull the data from the second data source. So if I get a match on Incident and Status, I want to pull the Count from the Join, if that is not blank or > 0, then return the actual value. 
 

numbervar DeviceCount:= 1;

 

IF {HPD.IBMst_Incident Type} LIKE "REQUEST*"

AND {HPD.Status} IN ["Assigned", "In Progress", "New", "Pending"] THEN

If {CHG_HPD_FulfillmentData.Count} >0 then DeviceCount:=  {CHG_HPD_FulfillmentData.Count} else 1

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 08 Apr 2011 at 3:49am

To display DeviceCount, modify your formula like this:

If {HPD.IBMst_IncidentType} like "REQUEST*" and
  {HPD.Status} in ["Assigned", "In Progress", "New", "Pending" then
  if {CHG_HPD_FulfillmentData.Count} > 0 then {CHG_HPD_FulfillmentData.Count}
    else 1
 
You don't really need the variable here, but if you have to use it for some reason, put a semi-colon after "else 1" and on the next line put the variable without the semicolon.
 
-Dell
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