用于编写用户定义的聚合函数的线索 [英] Clue for writing user-defined aggregate functions
问题描述
亲爱的论坛成员,
Ms access具有内置的聚合功能,如:
-Sum, Max,First,Avg,...
是否可以构建用户定义的聚合?
(如果您有任何线索,请不要犹豫post)
*我正在运行一个完整的查询,形式
选择VendorID,MyAggregate(VendorData)作为MyAggregate
来自Tbl;
按供应商ID分组;
其中函数MyAggregate不能通过任何组合复制
现有的聚合函数。
Dear member of the forum,
Ms access has built-in aggregate function like:
-Sum, Max, First, Avg, ...
Is it possible to build user-defined aggregate?
(if you have any clue, do not hesitate to post)
*I''m running a total query, of the form
Select VendorID, MyAggregate(VendorData) as MyAggregate
From Tbl;
Group By VendorID;
where the function "MyAggregate" cannot be replicate by any combination
of existing aggregate functions.
推荐答案
虽然是一个过时的标题,Trevor Best有一个创建自己的
域名函数的例子
http://easyweb.easynet.co.uk/~trevor...les.htm#doamin
-
Doug Steele,Microsoft Access MVP
http: //I.Am/DougSteele
(请不要发电子邮件!)
" neb" < GA *** @ yahoo.com>在消息中写道
news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
While a liitle of out date, Trevor Best has an example of creating your own
domain functions at
http://easyweb.easynet.co.uk/~trevor...les.htm#doamin
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"neb" <ga***@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
亲爱的论坛成员,
Ms access具有内置的聚合功能,如:
-Sum,Max,First,Avg,...
是否可以构建用户定义的聚合?
(如果您有任何线索,请不要犹豫发布)
*我正在运行一个完整的查询,形式
选择VendorID,MyAggregate(VendorData)为MyAggregate
来自Tbl;
Group By VendorID;
其中函数MyAggregate ;不能通过现有聚合函数的任何组合进行复制。
Dear member of the forum,
Ms access has built-in aggregate function like:
-Sum, Max, First, Avg, ...
Is it possible to build user-defined aggregate?
(if you have any clue, do not hesitate to post)
*I''m running a total query, of the form
Select VendorID, MyAggregate(VendorData) as MyAggregate
From Tbl;
Group By VendorID;
where the function "MyAggregate" cannot be replicate by any combination
of existing aggregate functions.
Trevor Best Solution能够编写域聚合函数,例如
:
-DLookup,DMax,DSum,...
但据我所知,这些功能只适用于现有的
对象(表或查询)。
一个能够编写用户定义的聚合函数的解决方案,
对我来说似乎更灵活。
是否有可能或者我应该限制自己的域聚合
功能?
*灵活性可以是通过比较语法来确定大小:
- Domaine聚合函数:
Dfunction(Field,ExistingTable,criteria),其中标准是
像在哪里条款
- 汇总函数:
MyAggregate(字段)+所有sql电源
Trevor Best Solution enable to write Domain aggregate function, such as
:
-DLookup, DMax, DSum,...
But, as far as I know, those function can only be apply on prexisting
object (table or query).
A solution that enables to write user-defined aggregate function,
seems more flexible to me.
Is it possible or should I restraint myself to domain aggregate
function?
*The flexibility can be size by comparing syntax :
- Domaine aggregate function :
Dfunction(Field, ExistingTable,criteria), where criteria is
like a "where" clause
- Aggregate function :
MyAggregate(Field) + All the sql power
" neb" < GA *** @ yahoo.com> schreef在bericht新闻:11 ********************** @ f14g2000cwb.googlegr oups.com ...
"neb" <ga***@yahoo.com> schreef in bericht news:11**********************@f14g2000cwb.googlegr oups.com...
是否有可能构建用户定义的聚合?
(如果您有任何线索,请不要犹豫发布)
*我正在运行一个完整的查询,形式为
选择VendorID,MyAggregate(VendorData)为MyAggregate
来自Tbl;
Group By VendorID;
Is it possible to build user-defined aggregate?
(if you have any clue, do not hesitate to post)
*I''m running a total query, of the form
Select VendorID, MyAggregate(VendorData) as MyAggregate
From Tbl;
Group By VendorID;
我不确定如果这是你要问的但是...
当然你可以编写自己的函数并在Totals查询中使用它。
选择VendorID ,MyAggregate(VendorData)为MyTotal''为了清楚起见,不要在这里使用函数名...
从Tbl''删除'';''这里......
按供应商ID分组;
Arno R
I am not sure if this is what you are asking but ...
Of course you can write your own function and use it in a Totals-query.
Select VendorID, MyAggregate(VendorData) as MyTotal ''don''t use the function-name here for the sake of clarity...
From Tbl ''remove '';'' here ...
Group By VendorID;
Arno R
这篇关于用于编写用户定义的聚合函数的线索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!