Converting string to Date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello! I have inherited a DB containing dates as nvarchar 50!! Is there a
function to convert this to a genuine datetime datatype?
 
Hi Jim,

There are zillions of ways of representing dates as text. The built-in
CDate() function will convert some of them; otherwise the usual
technique is to parse the string into numbers representing year, month
and day (using VBA functions such as Left(), Mid(), InStr()) and then
pass these to the DateSerial() function which combines them into returns
a date value.
 
Back
Top