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

Formula: Address fields not populating if null?

Status
Not open for further replies.

ziggs

Technical User
Sep 21, 2000
195
US
I will attach the formula at the bottom as an example. I'm trying to extract addresses to populate as a formula and I'm not getting the desired results. I isolated the problem a bit. With the database that I'm extracting from many of the entries do not have an apartment number in the field. Thus, only the entries with apts are populating. I would assume that this has something to do with null values. How can I introduce a formula to capture addresses with either apts or no apts

Here's the formula I'm using:

//Street Addresses
stringvar StNo := {INMAST.IM_LOC_STNO};
stringvar Str1 := {INMAST.IM_LOC_STR1};
stringvar Typ1 := {INMAST.IM_LOC_TYP1};
stringvar Apt := {INMAST.IM_LOC_APT};

//Destination
stringvar Location := "";

if StNo <> &quot; &quot; then Location := StNo + &quot; &quot;;
if Str1 <> &quot; &quot; then Location := Location + Str1 + &quot; &quot;;
if Typ1 <> &quot; &quot; then Location := Location + Typ1 + &quot; &quot;;
if Apt <> &quot; &quot; then Location := Location + &quot;#&quot; + Apt + &quot; &quot;;

Location;
[sig][/sig]
 
Sorry, I'm an idiot. I thought I checked the &quot;convert Null field to default&quot; but I changed it in the Options and not the Report Options too. Thanks anyway. It works fine now. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top