Borislav,
I think I've got the problem under control.
I kept stepping through the combination of SQL and a scan. That was the only way I could get range results from a resulting cursor.
Thanks for responding. I told my co-worker that this question would be like throwing a hook with a fat worm into a trout filled stream. So quick were the responses.
Bill
P.S. Glad to see that the Bulgarian medics were released.
>>I'm looking to count the number of incidents various ranges of months.
>>
>>Can the following query be done without the second procedural step -- purely in SQL?
>>
>>
>>*******************************
>>PROCEDURE GetViosInRange
>>*******************************
>>LPARAMETERS tcVioCat,tnLowMonths,tnHiMonths,tnLowBound,tnHiBound
>>LOCAL lnRetVal
>>SELECT * FROM WCDRVA ;
>>WHERE mvrcat = tcVioCat ;
>>AND BETWEEN(monthsago,tnLowMonths,tnHiMonths) ;
>>AND drvseq = this.drivernum;
>>INTO cursor thesevios
>>lnRetVal = 0
>>IF tnlowbound > 0
>> SKIP tnlowbound-1
>> SCAN WHILE RECNO() <= tnhibound
>> lnretval = lnretval + 1
>> ENDSCAN
>>endi
>>RETURN lnRetVal
>>
>
>Can you post some example data and what you want as a result from it?