I am trying to change the DateRequested from 2/27/2012 to 02-27-2012
my code is as such:
i am getting a Run Error: Overflow
What must i change? My date is returned as "02/27/2012"
(I found this code on the web and updated it with my values.)
my code is as such:
Code:
DateRequested = FormatDateTime(Date, 2)
Call DateManipulate(DateRequested) 'Insure date is MM/DD/YYYY format
year = Right(MM/DD/YYYY, 4)
month = left(MM/DD/YYYY, 2)
day = left(right(MM/DD/YYYY, 7), 2)
DateRequested = month & "-" & day & "-" & year
Public Function DateManipulate(eDate)
'Insure date is MM/DD/YYYY format
Set MyDate = DotNetFactory.CreateInstance("System.DateTime")
Set oDate = MyDate.Parse(eDate)
DateManipulate = oDate.ToString("MM/dd/yyyy")
eDate = DateManipulate
'msgbox DateManipulate
Set MyDate = Nothing
End Function
i am getting a Run Error: Overflow
What must i change? My date is returned as "02/27/2012"
(I found this code on the web and updated it with my values.)