I am trying to convert a date field to a JDEdwards date field which is 6 numeric (century = 1 position, year = 2 positions and day withing year = 3 positions).
I have a date of 8/4/2008 (mdyy) and that needs to be converted to 108217.
My code converts the date to 1008217 which is wrong (one zero too much)
Code:
Dim JdeDateFrom As Integer = (CLng(Format(Year(Date_From), "0000") + Format(DateDiff("d", CDate("01/01/" + Format(Year(Date_From), "0000")), Date_From) + 1, "000"))) - 1000000