Skip to Content
avatar image
Former Member

Help with formula please

I need an address to be printed on a form. The address can be in the form of address, city, state, zip or the address field can contain a location/site (example a room number or building name)

With the formula I have below, if the address is a room number or building name, it prints a comma after it.Exampe:Building#10,

How do I prevent the comma from printing?

I want it to show commas when the address has address, city, state, zip and no comma when it prints the room/building

IF NOT ({Use_Location.PERMIT_NO}LIKE"00-??-???" )

THEN '<font color = "blue">'&' '+'<b>'&"Equipment can be used only at:" & '</b> </font>' &'<font size ="+2">' & '<b>'& {@Use addr is blank} + {@Use city is blank} +{@Use state is blank} + {@Use zip is blank} & '</font>' & '</b>'

I created these formulas.

@Use addr is blank

IF Isnull ({Use_Location.USE_ADDRESS})

Then " "

Else {Use_Location.USE_ADDRESS} +’,’ + “ “

@Use city is blank

IF Isnull ({Use_Location.USE_CITY})

Then " "

Else {Use_Location.USE_CITY} +’,’ + “ “

@Use state is blank

IF Isnull IF Isnull ({Use_Location.USE_STATE})

Then " "

Else {Use_Location.USE_STATE} +’,’ + “ “

@Use zip is blank

IF Isnull ({Use_Location.USE_ZIP)

Then " "

Else {Use_Location.USE_ZIP}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 03, 2017 at 07:54 AM

    Hi Gina,

    1. Create a formula called @address with this code:

    stringvar addr := {@Use addr is blank} + {@Use city is blank} +{@Use state is blank} + {@Use zip is blank};
    if right(addr,2) = ", " then
    addr := Left(addr, Len(addr)-2)
    else addr;

    2. Modify the existing formula as:

    IF NOT ({Use_Location.PERMIT_NO}LIKE"00-??-???" ) THEN 
    '<font color = "blue">'&' '+'<b>'&"Equipment can be used only at:" & '</b> </font>' &'<font size ="+2">' & '<b>'& {@address} & '</font>' & '</b>'

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded