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

I agree with Cetin, SQL Server behaves this way too:
create table #temp1 ( i1 int, c1 char(10) )
insert into #temp1 values ( 1, 'test' )
insert into #temp1 values ( 2, 'test' )
insert into #temp1 values ( 3, 'test1' )

select sum( i1 ) 
   from #temp1
   where c1 = 'hi'
sometimes standards break non-standard behavior *g*

>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...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform