Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Khalil Shaddad
  Where is Khalil Shaddad?
 Beirut
 Lebanon
 Khalil Shaddad
 To: Simon Arnold
  Where is Simon Arnold?
 Halifax
 United Kingdom
 Simon Arnold
 Tags
Subject: RE: NULL VALUE
Thread ID: 16241 Message ID: 16246 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Monday, October 14, 2002 7:07:00 AM         
   


> > HI EXPERT,
> > HAVE NEW PROB NOW.Something like
> >
> > TABLE1
> >
> > UNIT1 UNIT2 TOTAL_UNIT
> >
> > 1 2 3 (formula i use is unit1+unit2)
> >
> > .NULL. 3 .NULL. (i want 3 in result)
> >
> >
> > Want add two colume of each record.But when one has .NULL. value the result also get null.
> > how can i avoid .NULL. value.
> > Please help me
> > Thanks
>
> Try this code to add values, checking to see if they contain NULL's, at the same time.
>
>
> lnVal = IIF(ISNULL(Unit1),0,Unit1) + IIF(ISNULL(Unit2),0,Unit2) + IIF(ISNULL(Unit3),0,Unit3)
> 

>
> Simon Arnold.

Or,
lnVal = NVL(Unit1,0) + NVL(Unit2,0) + NVL(Unit3,0)


Khalil Shaddad (Lebanon)

ENTIRE THREAD

NULL VALUE Posted by munir hossain @ 10/13/2002 5:12:49 PM
RE: NULL VALUE Posted by Simon Arnold @ 10/13/2002 9:04:25 PM
RE: NULL VALUE Posted by Khalil Shaddad @ 10/14/2002 7:07:00 AM