Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reusing variables
Message
From
29/08/2008 18:02:26
 
 
To
29/08/2008 17:58:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01343407
Message ID:
01343409
Views:
22
ALWAYS check _tally!
select sum(apr) from crsRpt where fisyear = fy into array a1
if _tally>0
   replace aprTotal with a1
endif
select sum(may) from crsRpt where fisyear = fy into array a1
if _tally>0
   replace mayTotal with a1
endif
select sum(jun) from crsRpt where fisyear = fy into array a1
if _tally>0
   replace junTotal with a1
endif
>Given a sequence like this
>select sum(apr) from crsRpt where fisyear = fy into array a1
>replace aprTotal with nvl(a1,0)
>select sum(may) from crsRpt where fisyear = fy into array a1
>replace mayTotal with nvl(a1,0)
>select sum(jun) from crsRpt where fisyear = fy into array a1
>replace junTotal with nvl(a1,0)
>you would think that if the select came up empty the array a1 would become null. However I find that instead of being reset to null the array simply carries over with its prior value. Is there a way to insure that it will be null if the select is empty?
>
>Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform