Lister
Z Shift
- Local time
- Today, 22:14
- Joined
- Aug 24, 2003
- Messages
- 305
Hi Guys, having a wee bit of bother with a select case statement handling a numeric range of values. Basically I’ve quite a bit of data that needs to be summarised. Per record, where each record could have 20 to 2000 readings with the same record number. There is a range, First Range: < -0.1, Second Range: >= -0.1 AND <= 0, Third Range >0
A sample of data would look like…
-0.14
-0.13
-0.07
-0.02
-0.01
0
0.02
0.17
0.18
0.24
So simple enough, count the number of readings for each record, count the number in each Range and you have the percentage of each range for each record.
But I’m having issue with the code I’m running from a recordset
I’m passing the reading value through to a double integer numeric variable but I just can’t seem to get the code to run correctly.
If someone could have a look and spot the no doubt obvious bug that would be great.
Thanks
A sample of data would look like…
-0.14
-0.13
-0.07
-0.02
-0.01
0
0.02
0.17
0.18
0.24
So simple enough, count the number of readings for each record, count the number in each Range and you have the percentage of each range for each record.
But I’m having issue with the code I’m running from a recordset
Code:
dblHolder = rs!skid_esc_rv
intCount = intCount + 1
Select Case dblHolder
Case dblHolder < -0.1
intBelow_TL = intBelow_TL + 1
Case dblHolder - 0.1 To 0
intBetween_TL_IL = intBetween_TL_IL + 1
Case dblHolder > 0
intAbove_IL = intAbove_IL + 1
Case Else
MsgBox rs!skid_esc_rv
End Select
I’m passing the reading value through to a double integer numeric variable but I just can’t seem to get the code to run correctly.
If someone could have a look and spot the no doubt obvious bug that would be great.
Thanks