San
Newcomer
I am trying with the below code which is part of a function but I get and error message saying Run-time exception thrown : System.InvalidCastException - Cast from string "21/06/2003" to type 'Date' is not valid
code is
dim dtRentalMonth as date
dim m_strMonYearMonth as string
' Value stored in m_strMonYearMonth is "200306"
dtRentalMonth = Format(m_strMonYearMonth, "0000-00-21")
I have tried using cdate and ctype functions but it is of no use
this willwork fine in vb6.0. in vb6.0 i get the result as 21/06/2003.
Any help on this will be appreciated.
Regards,
Santhosh
code is
dim dtRentalMonth as date
dim m_strMonYearMonth as string
' Value stored in m_strMonYearMonth is "200306"
dtRentalMonth = Format(m_strMonYearMonth, "0000-00-21")
I have tried using cdate and ctype functions but it is of no use
this willwork fine in vb6.0. in vb6.0 i get the result as 21/06/2003.
Any help on this will be appreciated.
Regards,
Santhosh