M
MikeB
Hi.
I'm trying to create a function to get the median value of a series
of observations. I've found an excellent reference on a MS website on
how to construct a query to obtain the median value, but I'm having a
bit of difficulty getting the query "visible" to access. Whenever I put
the function into the design grid it fails "undefined function 'Median'
in expression."
I created the function by clicking Insert -> Module. Access then
provided me with a Module1 (how do I rename it?) and I pasted the text
for the function into the module.
I tried running it and initially I had some difficulties with
mismatching parameters (I passed a string instead of a table name).
Once I got the errors ironed out, there are now other objects in my
Visual Basic Object list under a tree of "Utility".
Basically, I have the function Median coded as it is demonstrated in
http://support.microsoft.com/?id=210581.
I then have a query to extract a relevant list of records from the
table:
SELECT DateValue(Fix([EndDate])) AS [End], Fix(Date())-Fix([EndDate])
AS Age
FROM Listing
WHERE (((Listing.Status)="Pending Verification"))
ORDER BY DateValue(Fix([EndDate]));
Then I have the query that fails but is supposed to obtain the median
value:
SELECT Median([Listings Pending Verification Age List],[Age]) AS mEnd
FROM [Listings Pending Verification Age List];
I'd appreciate any help someone can give me.
Thanks.
I'm trying to create a function to get the median value of a series
of observations. I've found an excellent reference on a MS website on
how to construct a query to obtain the median value, but I'm having a
bit of difficulty getting the query "visible" to access. Whenever I put
the function into the design grid it fails "undefined function 'Median'
in expression."
I created the function by clicking Insert -> Module. Access then
provided me with a Module1 (how do I rename it?) and I pasted the text
for the function into the module.
I tried running it and initially I had some difficulties with
mismatching parameters (I passed a string instead of a table name).
Once I got the errors ironed out, there are now other objects in my
Visual Basic Object list under a tree of "Utility".
Basically, I have the function Median coded as it is demonstrated in
http://support.microsoft.com/?id=210581.
I then have a query to extract a relevant list of records from the
table:
SELECT DateValue(Fix([EndDate])) AS [End], Fix(Date())-Fix([EndDate])
AS Age
FROM Listing
WHERE (((Listing.Status)="Pending Verification"))
ORDER BY DateValue(Fix([EndDate]));
Then I have the query that fails but is supposed to obtain the median
value:
SELECT Median([Listings Pending Verification Age List],[Age]) AS mEnd
FROM [Listings Pending Verification Age List];
I'd appreciate any help someone can give me.
Thanks.