RevenueSwede
Programmer
Hi!
I'm stuck. Short description of project. I have a table with filled with batallions (yep Army stuff) and their educational periods. Example:
Name StartDate EndDate
Bat1 1/1/2008 12/31/2008
Bat2 1/1/2007 6/30/2008
Bat3 7/1/2008 1/1/2009
Now I want to search between 1/1/2008 and 12/31/2008 and see per month how many Bat are active in education. I want to create a two dimensional array with 12 months, for each month I want the number of bat active and the total amount in my search, in this example it will always be 3. Are you with me?
The reason I want it as an 2 dimensional array is that I need to write the data to an Excelfile and then create a graph based upon that.
I have began with some code, rs is a recordset holding my search.
If Not rs.EOF Then
' --- Number of rows ---
vRowCount = rs.GetRows
rowCount = UBound(vRowCount)
' --- Number of months in period ---
monthCount = DateDiff("m", startDate, endDate)
' --- Loop through each month then loop through whole recordset to check if is active
For i = 1 To monthCount
' --- Check month
' --- ????
Do While Not rs.EOF
rs.MoveNext
Loop
Next
End If
I'm stuck. Short description of project. I have a table with filled with batallions (yep Army stuff) and their educational periods. Example:
Name StartDate EndDate
Bat1 1/1/2008 12/31/2008
Bat2 1/1/2007 6/30/2008
Bat3 7/1/2008 1/1/2009
Now I want to search between 1/1/2008 and 12/31/2008 and see per month how many Bat are active in education. I want to create a two dimensional array with 12 months, for each month I want the number of bat active and the total amount in my search, in this example it will always be 3. Are you with me?
The reason I want it as an 2 dimensional array is that I need to write the data to an Excelfile and then create a graph based upon that.
I have began with some code, rs is a recordset holding my search.
If Not rs.EOF Then
' --- Number of rows ---
vRowCount = rs.GetRows
rowCount = UBound(vRowCount)
' --- Number of months in period ---
monthCount = DateDiff("m", startDate, endDate)
' --- Loop through each month then loop through whole recordset to check if is active
For i = 1 To monthCount
' --- Check month
' --- ????
Do While Not rs.EOF
rs.MoveNext
Loop
Next
End If