I'm having a weird issue trying to import a date from an xml file into our software. Some of the dates it reads just fine and puts them into a table and some with the same exact format are coming up blank. The date format is date="2012-01-16" here is the code I am using for the CTOD:
Note that aDate is the field I used to import the XML file.
so aDate = "2012-01-16"
Local cDate, cYear, cMonth, cDay, dDate
cDate = IIF(VARTYPE(aDate) = "C", CHRTRAN(aDate, "-", ""), SPACE(8))
cYear = LEFT(cDate, 4)
cMonth = SUBSTR(cDate, 5, 2)
cDay = RIGHT(cDate, 2)
dDate = CTOD(cMonth + "/" + cDay + "/" + cYear)
So the dDate sometimes displays correctly (01/16/2012) and sometimes displays " / / "
Anyone have this issue or an idea on how to solve it?
Thank you.
Note that aDate is the field I used to import the XML file.
so aDate = "2012-01-16"
Local cDate, cYear, cMonth, cDay, dDate
cDate = IIF(VARTYPE(aDate) = "C", CHRTRAN(aDate, "-", ""), SPACE(8))
cYear = LEFT(cDate, 4)
cMonth = SUBSTR(cDate, 5, 2)
cDay = RIGHT(cDate, 2)
dDate = CTOD(cMonth + "/" + cDay + "/" + cYear)
So the dDate sometimes displays correctly (01/16/2012) and sometimes displays " / / "
Anyone have this issue or an idea on how to solve it?
Thank you.