Let me comment, that whoever designed this "date" field in THIS way,
mdddyy, was 1) ignorant and 2) ought to be hanged by the thumb until numb!
All you need do is PARSE (you cannot use the Split() function as there is no CHARACTER upon which to parse), parse the Year, Month & Day into the arguments of the DateSerial() function, using the MID() starting with your original attempt...
[tt]
stringvar x := totext({PAYROLLDB_EVENT.TRANDATE},"000000");
dateserial(2000+val(mid(x,5,2),val(mid(x,1,2),val(mid(x,3,2))
[/tt]
Notice that the "number" is converted to a 6-character text string, not 7 characters as in your example.
This also assumes that you ONLY have twenty-FIRST century dates, hence adding 2000 to the year value.
Skip,
Just traded in my old subtlety...
for a NUANCE!![[tongue] [tongue] [tongue]](/data/assets/smilies/tongue.gif)