Not CDATE CVDate Used the Mid Function to break the string down to the individual components then used CVDate with the components in the right order to translate back to a date time.
Here's the function
the original string is 20120412092134
the result of the below function is 04/12/2012 9:21:34 AM
Code:
Public Function convertdate(byval strdate as string) as date
Dim stryear as string, strmonth as string, strday as string, strhour as string, strmin as string, strsec as string
stryear = left(strdate,4)
strmonth = mid(strdate,5,2)
strday = mid(strdate,7,2)
strhour = mid(strdate,9,2)
strmin = mid(strdate,11,2)
strsec = mid(strdate,13,2)
converdate = CVDATE(strmonth & "/" & strday & "/" & stryear & " " & strhour & ":" & strmin & ":" & strsec)
End Function