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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compute field formatting for mailing address in DW

Status
Not open for further replies.

mahalakshmis

Programmer
Apr 28, 2005
1
US
I want mailing address format like:

Owner name
Addl_owner name
secondary owner name
addl_addr

If anyone is missing, I should not get any blank lines inbetween.can anybody say whats wrong below? Am getting one empty line if I dont have addl_owner name . Others r working fine.


If ( Len(Trim(owner_first_name)) = 0 Or IsNull(owner_first_name ) , '', Trim(owner_first_name) ) +
If ( Len(Trim( owner_initial_name )) = 0 Or IsNull( owner_initial_name ) , '', ' ' + Trim(owner_initial_name) + '.' ) +
If(IsNull( owner_last_name ) or Len(Trim( owner_last_name )) = 0 ,'', ' ' + Trim(owner_last_name)) +
If(IsNull( owner_name_suffix ) or Len(Trim( owner_name_suffix )) = 0 ,'', ' ' +Trim(owner_name_suffix) + '.') +
'~r~n' +
If ( Len(Trim(addl_owner_first_name)) = 0 Or IsNull(addl_owner_first_name ) , '',Trim(addl_owner_first_name) ) +
If ( Len(Trim(addl_owner_initial_name )) = 0 Or IsNull(addl_owner_initial_name ) , '', ' ' + Trim(addl_owner_initial_name) + '.') +
If(IsNull(addl_owner_last_name ) or Len(Trim(addl_owner_last_name )) = 0 ,'', ' ' + Trim(addl_owner_last_name)) +
If(IsNull(addl_owner_name_suffix ) or Len(Trim(addl_owner_name_suffix )) = 0 ,'', ' ' + Trim(addl_owner_name_suffix) + '.') + '~r~n' +
If(isNull(secondary_name ) Or len(secondary_name) = 0, '',trim(secondary_name) +'~r~n') +
if(isNull(owner_addl_addr) Or len(owner_addl_addr)=0,'',trim(owner_addl_addr))


Tq
M
 
Well of course you will get a blank line because the carriage return/line feed pair are not part of the test they are always included:

If(IsNull(addl_owner_name_suffix ) or Len(Trim(addl_owner_name_suffix )) = 0 ,'', ' ' + Trim(addl_owner_name_suffix) + '.') + '~r~n' +

In another line (ie one that works) the CR/LF is included in the test:

If(isNull(secondary_name ) Or len(secondary_name) = 0, '',trim(secondary_name) +'~r~n') +

See what I mean?

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top