Mike Peat
11-May-2017, 01:10 PM
I don't know if this is a new error in 19.0 (I suspect not, but beta 3 of that is what I am working with), but if the date format is set to DF_DATE_EUROPEAN a DataFlex Date (or DateTime) with a "day" value > 12 causes an error if moved to an MSSQL DateTime type column.
The following code errors (written on the May 11th, so the error happens on the third time through the loop and thereafter):
Use Windows.pkg
Set_Attribute DF_DATE_FORMAT to DF_DATE_EUROPEAN
Open "GSjobdet.int" as Gsjobdet
Procedure DateTest
DateTime dtTest
Date dTest
Integer i
Sysdate dTest
For i from 0 to 9
Move dTest to dtTest
Move dtTest to GSJOBDET.ASSIGNEDDATE
Move (DateAddDay(dTest, 1)) to dTest // Could use "Increment dTest" here, but I'm being good! <g>
Loop
End_Procedure
Send DateTest
(Note: I am using the Open AS approach to keep the code simple.)
GSJOBDET.ASSIGNEDDATE is MSSQL type "datetime".
Moving either dTest or dtTest to it causes an error: "Please enter a valid date" when the Watches window shows dTest as 13/05/2017 and dtTest as 5/13/2017 12:00:00 AM.
Any thoughts on how to fix/avoid the problem? I'm sure this must have come up before, but I can't find any mention of it.
Mike
The following code errors (written on the May 11th, so the error happens on the third time through the loop and thereafter):
Use Windows.pkg
Set_Attribute DF_DATE_FORMAT to DF_DATE_EUROPEAN
Open "GSjobdet.int" as Gsjobdet
Procedure DateTest
DateTime dtTest
Date dTest
Integer i
Sysdate dTest
For i from 0 to 9
Move dTest to dtTest
Move dtTest to GSJOBDET.ASSIGNEDDATE
Move (DateAddDay(dTest, 1)) to dTest // Could use "Increment dTest" here, but I'm being good! <g>
Loop
End_Procedure
Send DateTest
(Note: I am using the Open AS approach to keep the code simple.)
GSJOBDET.ASSIGNEDDATE is MSSQL type "datetime".
Moving either dTest or dtTest to it causes an error: "Please enter a valid date" when the Watches window shows dTest as 13/05/2017 and dtTest as 5/13/2017 12:00:00 AM.
Any thoughts on how to fix/avoid the problem? I'm sure this must have come up before, but I can't find any mention of it.
Mike