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

Concatinating String Fields

Status
Not open for further replies.

malam123

Programmer
May 23, 2006
13
US
I have 5 strings fields which needs to be concatinated and diplayed together,I know this pretty simple but its not displaying any data.Its a address field,need to display as
street 0
street 1
city zip
state
 
You probably need to check for nulls. You could use:

(
if isnull({table.street0}) then "" else
{table.street0} + chr(13)
) +
(
if isnull({table.street1}) then "" else
{table.1} + chr(13)
) +
(
if isnull({table.city}) then "" else
{table.city} +chr(13)
) +
(
if isnull({table.state}) then "" else
{table.state}
)
(
if isnull({table.zip}) then "" else
" "+{table.zip}
)

This assumes you really meant the zip to be on the line with state.

An alternative would be to write separate formulas for each field that can be null and place them in separate detail sections, and then format each detail section to "suppress blank section".

-LB
 
Go with LBs second suggestion.

Right click the details and select insert section below.

Now place each line into it's own section, right click each section and select format section->suppress blank section.

Now if the line is blank it will be suppressed, and no messy coding.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top