Wrong Date 2010

kohle

Active Member
Licensed User
Longtime User
It returns 03.01.0001

DateFormat ("dd.mm.yyyy")
x = DateParse (DateD & "." & DateM & "." & DateY)
Msgbox(Date(x))
 

corwin42

Expert
Licensed User
Longtime User
DateD and DateM return the day/month without leading zeros so your code results in:

x = DateParse ("3.1.2010")

and this does not match your Dateformat.

Try

x = DateParse (Format(DateD, "D2") & "." & Format(DateM, "D2") & "." & Format(DateY, "D4"))

instead
 
Top