Converting Date Fields in Character Format to Date Format
If you have multiple date
If you have multiple date formats you can do something like this in the equation editor where you are looking for each different format and then changing the @Ctod based on the format.
@CompIf(@Mid(DATE, 2, 1) = "/" .AND. @Mid(DATE, 4, 1) = "/", @Ctod(DATE, "D/M/YYYY"), @Mid(DATE, 3, 1) = "/" .AND. @Mid(DATE, 5, 1) = "/", @Ctod(DATE, "DD/M/YYYY"), @Mid(DATE, 2, 1) = "/" .AND. @Mid(DATE, 5, 1) = "/", @Ctod(DATE, "D/MM/YYYY"),1, @Ctod(DATE, "DD/MM/YYYY"))
As you can see I am using the locations of the / to figure out the formatting.
I'm trying to convert a date
I'm trying to convert a date field from a character type to a date type by using the following: @ctod(RECEIPT_DATE,"DD/MM/YYYY")
The field name is correct and the dates are in the format: 07/01/2019, 26/11/2018 etc.
When validating, there are no errors, however, when I press OK to execuate the change, I get the following error "A valid date mask is required for this field". I believe all the dates in this field have the same format.
Any idea what could be the cause?
I am assuming this is a
I am assuming this is a fairly common problem...
What is the most efficient way to utilize the @Ctod function, when you have two different masks... Example:
The field "Transactions Date" has a wide array of ranges from January through December, but the masks are different. 1/2/2019 (8 characters) and 12/12/2019 (10 Characters).