|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
[ACCESS] write an agregate function
Hello,
does anyone knows how to write an agregate function in VB for use in a query in access? for example, could you rewrite the avg(field_name) function in VB? thanks for your answers ![]() |
|
#2
|
||||
|
||||
|
can't answer your VB question, but access does have an AVG() function built in, so you could just use that in the query...
|
|
#3
|
||||
|
||||
|
hmm.. I think he was using the avg() function as an example
I'll look it up and see if I can help u there. That would be really helpful for me too.. |
|
#4
|
|||
|
|||
|
Quote:
Yes, it was just an example. It is a function that computes the _mediane_ (in french) on one field according to some WHERE restrictions that i wanna write. |
|
#5
|
|||
|
|||
|
I think your question can be generalised a bit.
Does anybody know how to call any vb/vba function from an sql statement in ACCESS?
__________________
-- ngibsonau |
|
#6
|
|||
|
|||
|
uh, by its name...
|
|
#7
|
||||
|
||||
|
well u can just call the function by its name, but to be able to do that, your function has to be declared public.
|
|
#8
|
|||
|
|||
|
Ok. so my question was a little too general.
I'll modify it. the problem as I see it turns into: how to make a vb/vba function that can be called via slq in Access and takes a field name as an argument. How do you do the last bit. We want a to be able to pass column names with enclosing them in quotes eg. Code:
select avg(x) from tbl we don't want Code:
select avg('x') from tbl
which would a a work around but not really standard. What is the syntax for the argument in vb? |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > [ACCESS] write an agregate function |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|