V4RB - Retrieving Aggregate Function Values from Cursor

Fitzbew at aol.com Fitzbew at aol.com
Sun May 18 23:01:06 CDT 2003


I am having trouble retrieving a MIN() value from a cursor (using V4RB 1.9.7, 
RB 4.5.2).   

I have a String field in a database (I have verified the database values are 
correctly populated) that is populated with 'YYYY' values (1995, 1996...).   
Each value can occur multiple times. I am running this query:

rstDB = dbAvx.SqlSelect("select DISTINCT Min(Date_from_YYYY) from 
mainrecords")
(Excluding DISTINCT has no effect on the result.)

The query returns a cursor with 1 record, however I have not been able to 
retrieve the field value.

This is how it was suggested to me to retrieve the value from the recordset:

varStr = rstDB.StringField(1).Value

But using this method, varStr is not populated correctly. The resulting 
varType of the varStr variable is String(8), but it is zero-length.    It is 
not Null. 

What am I doing wrong?    

Thanks in advance for any help,
Fitzbew


More information about the Valentina mailing list