[V4MD] Max aggregate function in director

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Aug 24 21:33:48 CDT 2004


On 8/24/04 9:28 PM, "Daniel Crowder" <daniel at monumental-i.com> wrote:

> Ruslan,
> 
> Can you give me more information about how to do what you describe below?

You create bo method exctly as regular field,
Just add one more parameter -- formula.
Look into V4MD Refernce for function MakeNewField()
Something as

    MakeNewField( "mRecID", #UlongType, ...,  "RecID" )


That is all.
Now you have one more VIRTUAL FIELD in the table.
Its name is mRecID

And you can uese

    SELECT MAX( mRecID ) FROM ........
 


>> Workaround is:
>>    create BaseObject method of ULONG type with simple formula
>>        "ReCID"
>> 
>>    i.e. This BaseObject method will have the same value.
>> 
>> Try apply MAX to this BaseObject method.
>>  
>> 
> 
> Also, is there a quick method to get the most recently added record from
> a table where a date is not stored?
> 
> This is my first Valentina project so I appologize for all the newb
> questions!

If you preapre cursor as

    SELECT RecID, .... FROM ....


Then after 

    cursor.AddRecord()


The field RecID of this cursor will contain RecID of just added record.




-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list