Unable to split date string in access?
I need to split a date that is in the the form of a string, they must be declared as strings and not dates. The problem is that I cannot extract the day using day(dateStr), month(dateStr) and year(dateStr). These funtions produce a type error 13 type mismatch.
Dim dateStr As String
Dim dateStr2 As String
'dateStr2 = hold1 & "/" & hold2 & "/" & hold3
dateStr2 = "01/12/2008"
dateStr = Format(dateStr2, "dd/mm/yyyy")
Debug.Print day(dateStr)
I need to split a date that is in the the form of a string, they must be declared as strings and not dates. The problem is that I cannot extract the day using day(dateStr), month(dateStr) and year(dateStr). These funtions produce a type error 13 type mismatch.
Dim dateStr As String
Dim dateStr2 As String
'dateStr2 = hold1 & "/" & hold2 & "/" & hold3
dateStr2 = "01/12/2008"
dateStr = Format(dateStr2, "dd/mm/yyyy")
Debug.Print day(dateStr)