Search code examples
ms-accessvbams-access-2003

convert mmmdd,yyyy string into date VBA


How can I convert string mmmdd,yyyy (Apr16,2015) into date format? Cdate and datevalue does not work here Thanks in advance.


Solution

  • "Apr 16 2015" is parsable so:

    dateStr = "Apr16,2015"
    ?cdate(left$(dateStr, 3) & " " & mid$(dateStr, 4, 2) & " " & right$(dateStr, 4))
    16/04/2015