General information
Category:
Coding, syntax & commands
Brenda
Yes I did find that if the group by clause is included, _tally gives the same result for vfp8 and vfp9. I am now in the progress of finding all the offending sql code and either adding a group by clause or setting the enginebehavior to 80. I prefer the former solution if possible.
Gaylen
>Got the following from a previous message that you posted.
>
>>The _TALLY after a query holds the number of records in the result not the >number of record matching the query criteria. In VFP9 a query with >aggreagate function, like SUM()/ MAX()/e.t.c, without GROUP BY clause >returns a single record with all nulls as required by ANSI SQL standard. >It's documented in SET ENGINEBEHAVIOR help topic. It actualy makes your >code simplier.
>
>>SELECT NVL(SUM(prem+expc+teri+late_fee+penalty),0) ;
>> FROM cur_ar WHERE LEFT(ALLTRIM(ar_type),1) == "C" ;
>> INTO ARRAY arTotalc
>>lnarTotalc = arTotalc
>
>It seems that if you add a GROUP BY clause to a MIN,MAX,COUNTY,SUM function SQL it makes the SQL results as in VFP8 - when there are no matching records. Either with or without the NVL, when there are no matching records the result set is empty and _tally is 0.
>Do you find this to be true?
>
>Brenda
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only