Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Finding the first applicable field Post Reply Post New Topic
Author Message
VickiM
Newbie
Newbie
Avatar

Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 28
Quote VickiM Replybullet Topic: Finding the first applicable field
    Posted: 26 Jun 2013 at 9:54am
Hi.
 
I am working on a report where I need to pull an emergency contact number for employees.
 
In our database, someone may have listed up to 9 people has their emergency contact and they have a seqence number assoicated with them. 1,2, 3, etc.
 
The problem I'm having is:
Some people have never entered a contact but I still need them to show up on my list.  So I need blank fields.
Some people have entered several contacts, then removed some so they may have a contact number in sequence 1, 2, 5 or they may skip all the way to 9.
 
How do I pull in people who have never entered a contact and, pull in the other people's first contact record regardless of what the sequence number is on that field?
 
In other words, if someone doesn't have anything filled in for a contact period, I want them, if someone has 1 and 5 filled in, I want 1, if someone only has 9 filled in I want 9.
 
Any help will be appreciated!
 
 
 
 
VickiM
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 27 Jun 2013 at 4:47am
are you joining straight to the database tables or are you using a stored proc?

joining straight, I would use a outer join from the employee table to the contact table (this displays people without contacts).
Then I would order by the sequence number of the contact and display the information in the group header (this will display just one contact, and it will be either the first or the last contact (depending on if the order is ascending or descending)

HTH
IP IP Logged
VickiM
Newbie
Newbie
Avatar

Joined: 02 May 2011
Location: United States
Online Status: Offline
Posts: 28
Quote VickiM Replybullet Posted: 27 Jun 2013 at 4:52am
I'll try that.  Thank you!
VickiM
IP IP Logged
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.031 seconds.