Good afternoon all,
I am trying to convert a date to an integer in Microsoft Visual Basic
2003 .NET and am experiencing a little trouble trying to get it done.
This is what I want to do:
Date_001 = Array_001(0)
Date_002 = Array_001(1)
If (Date_001 - Date_002) <= Array_002(i, 0) Then
Value_Reference = i
Value_Found = True
Exit For
Else
End If
However, I have to convert the Date_001 and Date_002 variables to
Decimals or Integers before I can do this
If (System.Convert .ToDecimal(Date _001) -
System.Convert. ToDecimal(Date_ 002)) <= Array_002(i, 0) Then
I have tried using the Change type, but this returns a 'Run-time
exception thrown : System.InvalidC astException - Cast from type 'Date'
to type 'Integer' is not valid.' error.
(Convert.Change Type(Creation_D ate, GetType(DateTim e)), Integer)
Any assistance you may be able to provide would be greatly appreciated.
Yours sincerely,
William Foster
*** Sent via Developersdex http://www.developersdex.com ***
I am trying to convert a date to an integer in Microsoft Visual Basic
2003 .NET and am experiencing a little trouble trying to get it done.
This is what I want to do:
Date_001 = Array_001(0)
Date_002 = Array_001(1)
If (Date_001 - Date_002) <= Array_002(i, 0) Then
Value_Reference = i
Value_Found = True
Exit For
Else
End If
However, I have to convert the Date_001 and Date_002 variables to
Decimals or Integers before I can do this
If (System.Convert .ToDecimal(Date _001) -
System.Convert. ToDecimal(Date_ 002)) <= Array_002(i, 0) Then
I have tried using the Change type, but this returns a 'Run-time
exception thrown : System.InvalidC astException - Cast from type 'Date'
to type 'Integer' is not valid.' error.
(Convert.Change Type(Creation_D ate, GetType(DateTim e)), Integer)
Any assistance you may be able to provide would be greatly appreciated.
Yours sincerely,
William Foster
*** Sent via Developersdex http://www.developersdex.com ***
Comment