VB - Invalid use of Null: CInt - Trying to use value from DATEDIFF as an Index for an array.
Posted on 2004-11-08
I'm guessing that it's going to be something obvious for someone, but I can't see it. I'm counting up the number of cases based upon how old they are. Below is my code, and I get the error on the DateDiff line.
ERROR: Invalid use of Null: 'CInt'
Do While Not rsClientInfo.EOF
If rsClientInfo("CaseOpenDate") = Null Then
Response.Write "This is BS" & rsClientInfo("CaseNumber") ' <-- None Found
YearsOpen = CInt(DATEDIFF("y", rsClientInfo("CaseOpenDate"), Now()))
If YearsOpen > 4 Then
YearsOpen = 4
CaseCount(YearsOpen) = CaseCount(YearsOpen) + 1