Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: If statements w/ multiple tables Post Reply Post New Topic
Author Message
bullsfan03
Newbie
Newbie


Joined: 12 Jul 2012
Online Status: Offline
Posts: 5
Quote bullsfan03 Replybullet Topic: If statements w/ multiple tables
     Posted: 12 Sep 2012 at 6:22am
Currently struggling using Crystal Reports formulas. Unfamiliar with the syntax

Anyways I'm making a report that pulls Codes from 2 different tables for an EEO form. Some employees are assigned "Jobs" and others are assigned "Positions" so they are stored in different tables.

The EEO Code in the Jobs table is "eeo_sub_code". These codes are just the Digits 2-9.

The EEO Code in the Positions Table is "position_group_code". These codes are EEO2...EEO9.
I want them all displayed as EEO2....EEO9

jobs.eeo_sub_code and positions.position_group_code essentially contain the same info that I need to grab. Both contain EEO codes, I'm just trying to merge them into 1 column in my report.

This is what I have so far... it's only displaying the jobs.eeo_sub_code condition

if {jobs.eeo_sub_code} = '2' OR {positions.position_group_code} = 'EEO2' then 'EEO2'
else if {jobs.eeo_sub_code} = '3' OR {positions.position_group_code} = 'EEO3' then 'EEO3'
else if {jobs.eeo_sub_code} = '4' OR {positions.position_group_code} = 'EEO4' then 'EEO4'
else if {jobs.eeo_sub_code} = '5' OR {positions.position_group_code} = 'EEO5' then 'EEO5'
else if {jobs.eeo_sub_code} = '6' OR {positions.position_group_code} = 'EEO6' then 'EEO6'
else if {jobs.eeo_sub_code} = '7' OR {positions.position_group_code} = 'EEO7' then 'EEO7'
else if {jobs.eeo_sub_code} = '8' OR {positions.position_group_code} = 'EEO8' then 'EEO8'
else if {jobs.eeo_sub_code} = '9' OR {positions.position_group_code} = 'EEO9' then 'EEO9'

Any help is appreciated
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Sep 2012 at 7:18am
i assume you used outer joins in your table links and that you have NULL values from one table or the other
Unless you tell Crystal how to handle nulls it will stop evaluating the formula when it hits a null.
In the formula editor try changing the pick list option from 'Exceptions for Nulls' To 'use Default values for nulls'


Edited by DBlank - 12 Sep 2012 at 7:19am
IP IP Logged
bullsfan03
Newbie
Newbie


Joined: 12 Jul 2012
Online Status: Offline
Posts: 5
Quote bullsfan03 Replybullet Posted: 12 Sep 2012 at 7:58am
DBlank -- This worked like a charm! Such a simple fix, thank you so much!
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