I am new to all of this, so any help, direction and expertise is appreciated.
I have a query that runs and filters all kinds of information. In that query I want to run a function, but am not sure what parameters I should use. I am trying to use the orginal parameters of the function but continue to get parameter and syntax errors. Here is my function and
I have a query that runs and filters all kinds of information. In that query I want to run a function, but am not sure what parameters I should use. I am trying to use the orginal parameters of the function but continue to get parameter and syntax errors. Here is my function and
Code:
Public Function Quartile(data_table As String, data As String, k As Double) As Double
Dim rst As ADODB.Recordset
Dim dblData() As Double
Dim xl As Object
Dim x As Integer
Set xl = CreateObject("Excel.Application")
Set rst = New ADODB.Recordset
rst.Open "Select * from " & data_table, CurrentProject.Connection, adOpenStatic
ReDim dblData(rst.RecordCount - 1)
For x = 0 To (rst.RecordCount - 1)
dblData(x) = rst(data)
rst.MoveNext
Next x
Quartile = xl.WorksheetFunction.Quartile(dblData, k)
rst.Close
Set rst = Nothing
Set xl = Nothing
End Function
Qry=
Quartile: [dbldata][3]