Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Most recent home address Post Reply Post New Topic
Author Message
Jock
Newbie
Newbie
Avatar

Joined: 29 Mar 2012
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Jock Replybullet Topic: Most recent home address
    Posted: 26 Feb 2018 at 1:01am
What would be the best method of only showing the current address for an individual whilst ignoring all previous addresses?
In our db, there is an "Effective To Date" which, in the most recent address, would be blank.
When adding address lines to the 'details' area in a report, all adresses for the person are displayed but I want to create a letter which needs the most recent.
Any ideas on how to approach this?
Traa dy liooar
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Feb 2018 at 7:15am
Are you trying to reduce the data pull before you get it into Crystal? Can you write a stored procedure or view to limit the data and you that as your data source? What about a crystal Command?
Depending on outer join requirements and how many other tables were involved I would do this via a store procedure that would either conditionally join use a where condition as "and addresstable.EffectiveToDate is null).
You may be able to add that as a select criteria in Crystal but I don't know if you have other data issues like outer joins or future dated end dates or other issues to deal with.
IP IP Logged
Jock
Newbie
Newbie
Avatar

Joined: 29 Mar 2012
Location: United Kingdom
Online Status: Offline
Posts: 6
Quote Jock Replybullet Posted: 26 Feb 2018 at 10:21pm
I got the result by adding a formula whereby if the end date isnull, show "O" (for open). Then showing only "O" in select expert.
Probably not the slickest method but it works!
Thanks for the reply.
Traa dy liooar
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.016 seconds.