Help creating an array

K

kidkosmo

Hi, all,

I'm having a difficult time creating an array. This is new territory
for me, so any help would be great!

I have a table listing the number of days to close a trouble ticket.
I need to create an array that combines all of that data to perform a
calculation. Then, I need to create a second variable with a count of
the number of elements in that array.

Here's my SQL statement:

strSQL="SELECT TAT from tbl_TEMP_CRCalc"

I need a variant to combine all of those values plus a second integer
to count those records.

THANKS!
 
M

MikeB

Hi, all,

I'm having a difficult time creating an array.  This is new territory
for me, so any help would be great!

I have a table listing the number of days to close a trouble ticket.
I need to create an array that combines all of that data to perform a
calculation.  Then, I need to create a second variable with a count of
the number of elements in that array.

Here's my SQL statement:

strSQL="SELECT TAT from tbl_TEMP_CRCalc"

I need a variant to combine all of those values plus a second integer
to count those records.

THANKS!

There is a Count() function that will count the number of records.
There are also functions to get the Max, Min, Afg and a number of
other statistical derivatives of a range of data. Perhaps these would
be useful?
 
K

kidkosmo

There is a Count() function that will count the number of records.
There are also functions to get the Max, Min, Afg and a number of
other statistical derivatives of a range of data. Perhaps these would
be useful?- Hide quoted text -

- Show quoted text -

I figured I can use Count() to get the number of records from the
table. That should be sufficient, but I still need to capture the
values into an array. I am trying to enter these items into the
Percentile function from a previous post. My previous post was named
"80th percentile" if that helps to get the background of my dilemma.
 
K

ken

The GetRows method of the Recordset object will fill a two-dimensional
array with the contents of a recordset, e.g.

Dim dbs As DAO.Database, rst As DAO.Recordset
Dim strSQL As String
Dim lngCount As Long
Dim aVals()

strSQL = "SELECT TAT from tbl_TEMP_CRCalc"

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)

' fill array
aVals = rst.GetRows()
' get count of rows
lngCount = rst.Count

Ken Sheridan
Stafford, England
 
K

kidkosmo

The GetRows method of the Recordset object will fill a two-dimensionalarraywith the contents of a recordset, e.g.

    Dim dbs As DAO.Database, rst As DAO.Recordset
    Dim strSQL As String
    Dim lngCount As Long
    Dim aVals()

    strSQL = "SELECT TAT from tbl_TEMP_CRCalc"

    Set dbs = CurrentDb
    Set rst = dbs.OpenRecordset(strSQL)

     ' fillarray
    aVals = rst.GetRows()
    ' get count of rows
    lngCount = rst.Count

Ken Sheridan
Stafford, England




- Show quoted text -

I'm receiving a Compile error on the "rst.count". The error messages
states "Method or data member not found". Ideas?
 
K

kidkosmo

I'm receiving a Compile error on the "rst.count".  The error messages
states "Method or data member not found".  Ideas?- Hide quoted text -

- Show quoted text -

Never mind...I just saw Ken's last post. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top