Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Address Hierachy Help Post Reply Post New Topic
Author Message
chris.solan
Newbie
Newbie
Avatar

Joined: 10 Sep 2012
Location: United States
Online Status: Offline
Posts: 3
Quote chris.solan Replybullet Topic: Address Hierachy Help
    Posted: 10 Sep 2012 at 5:44am
We have a customer database that allows multiple address for a client. ie Mailing, billing, vacation, etc. We have an address hierarchy to follow. I would like to have CR looking into the address type field and choose ONE address from a list and that address be the highest on the hierarchy table. For example, if a "bi" exists, then use that address, if not move down to the "ma" address, if it exists us it, if not, the move down to the "bu" and so on and so on and if "null" use the default address on the account. Thanks in advance for your help.

Chris

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Sep 2012 at 5:54am

you will have to explain your data storage more.

Are these all on one row per person? one table? One table per type?
IP IP Logged
chris.solan
Newbie
Newbie
Avatar

Joined: 10 Sep 2012
Location: United States
Online Status: Offline
Posts: 3
Quote chris.solan Replybullet Posted: 11 Sep 2012 at 8:18am
Thank you so much for the reply!   
All the address are in a single table - UCRADDR
Each address type is on its own line.
Each customer can have more than one line.

CUST_CODE    ADD_TYPE     CITY           ACCT_STATUS
2419           BI        SPOKANE            A
2420           BI        CHICAGO            I
2421           BI        BRADENTON          A
2421           MA        MIAMI              A
2421           SB        PORTLAND           A
2421           HQ        SAN JOSE           A
2421           HM        KENOSHA            A
2422           BI        ERIE               I
2422           MA        DALLAS             A
2423           BI        CORONA             A

of course there are more fields, but I just wanted to give you a picture of what the table looks like.
If you need anything else, please just let me know.

Thanks again!!!!

Chris
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 11 Sep 2012 at 8:35am
if this is just a matter of displaying the 'correct' address
 
group on the customercode
create a formual to sort your addresses in the order of importance you need
 
if isnull(add_type) then 0 else
if add_type='BU' then 1 else
if add_type='BMA' then 2 else
if add_type='Bi' then 3 else
etc.
 
Sort on this fomrual field
place the address field in the group footer
this will only show the last address in for that customer
hide the detail section
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.