Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple address on record

Status
Not open for further replies.

mikefight

Programmer
Feb 2, 2007
14
0
0
I need to print a specific address. I keep getting the address printing twice or not at all. I am new to cr 11.

Crytsal version 11
SQL database
name type = o
name type = 3 and maileoverride = 1

if account has a name with type = 3 and override = 1 then
print override address
else print address with name type = 0

How to I get just one address to show, this is for a mailing list output to excel.



 
You almost have it. Use a formula like the following in the detail section instead of your address fields:

if {table.nametype} = 3 and
{table.override} = 1 then
{table.overrideaddress} else
if {table.nametype} = 0 then
{table.address}

-LB
 
I did that and I get...

account address
---------------------------------
12345 type 0 address
12345 override adress

So I am getting both addresses. I only want the override, or the primary if there is no override.
 
Insert a group on account and place the formula in the group header.

-LB
 
I am only getting the name type 0 address in the group header.

I also tried the below code and got blank.
stringVar street;

if {NAME.TYPE} = 3 and {NAME.MAILOVERRIDE} = 1 then
street = {NAME.STREET};

if {NAME.TYPE} = 0 and street = "" then
street = {NAME.STREET};

street;

 
You should sort the report by the override field in descending order, and then the record in the group header will always be the override address. Please try my formula again in the group header after doing the sort.

-LB
 
That worked

Awesome, thank you so much. Now if I can just get it to exported to excel.
 
If you are trying to set up separate columns for name, address, city, state, and zip, e.g., then attach each column to the gridlines on the left, right, and bottom, so that neighboring fields touch the same gridline. Also select all fields->format objects->make same size->make same height. Remove any headers and then export to Excel using the data only option.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top