[V4MD] Max aggregate function in director

Daniel Crowder daniel at monumental-i.com
Tue Aug 24 17:07:16 CDT 2004


Ruslan,

I tried what you suggested and am not having any luck.

When I create the table I have added the following field:

addField(pdb.db, product_ref, "id", #kTypeUlong, "RecID")

If I understand you correctly, this should automatically serialize the 
"id" field with the RecID of that record.

When I do this and view the records all the "id" fields show a value of 
'0'.




On Aug 24, 2004, at 2:33 PM, Ruslan Zasukhin wrote:

> 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
> -------------------------------------------------------------
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
>



More information about the Valentina mailing list