Code: Select all
local cDate as String
cDate := Str(5,2,0) + "/01/" + Str(2020,4,0)
local dDate as Date
dDate := CToD(cDate)
? dDate
Console.ReadKey()
In VO dDate would be "05/01/2020", but in X#, it is NULL_DATE. The reason is because of a space in front of the month. In this case cDate is actually " 5/01/2020". If I trim cDate before converting to date, then the result is the same as in VO.
Code: Select all
dDate := CToD(AllTrim(cDate))
Boonnam