Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When SELECT SUM()... doesnt
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
When SELECT SUM()... doesnt
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00999926
Message ID:
00999926
Views:
71
Just an FYI

I just had an error under VFP9, that worked ok under VFP8. The problem was with SUM(). Working on a clients project, they had a
select sum( somefield ) FinalValue;
   from sometable ;
   where testclause ;
   into cursor myresult
Under VFP8, even if no records matched the "MyResult.FinalValue" was always coming back as a valid numeric value, even if it was zero.

However, under VFP9, if no records qualified the where clause, the value came back as NULL. So... caution if you may have something like this and a possible no qualified results be sure to check for NULL...
Next
Reply
Map
View

Click here to load this message in the networking platform