Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Summing up data with null values
Message
From
01/05/2005 13:27:07
 
 
To
01/05/2005 12:42:17
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01010013
Message ID:
01010020
Views:
25
Hello,

either use:

IF (NVL(curcursor.CURRENT,0) + NVL(tdcursor.thirtydays,0) + NVL(sdcursor.sixtydays,0) + NVL(npcursor.ninetyplus,0) + NVL(custdetail.deposit)) != 0

or exclude NULL's in the first place:

SELECT NVL(SUM(totaldue-totalpaid),0) AS CURRENT FROM tempinvpostless30 INTO CURSOR curcursor WHERE ALLTRIM(custno) == ALLTRIM(scancust.custno)

...

besides this, assuming custno is the tables primary/foreign key
you're better of not using ALLTRIM in the SELECT statements since this isn't optimizable by rushmore

Regards
Christian
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform