Date format in the dataport import

nc235nc235 Member Posts: 8
Hello,
I've got a problem trying to import Posting date in a format wich differs from my Date Region settings, using format() function.
It seems that format() works only for export dataports.
Does anybody know possible solution or work around?

Thank you for any help!

Comments

  • jversusjjversusj Member Posts: 489
    I had to do this a few years ago. I'm sure it isn't the best way, or the most elegant, but here is what i did.

    in my scenario, The date i was working with was always in DDMMYYYY format (and my regional settings were MMDDYYYY)
    IF InReqShipDate <> '' THEN BEGIN
        DefineDateFormat(InReqShipDate);
        ReqShipDate := DMY2DATE(intMonth,intDay,intYear);
        SalesHeader.VALIDATE("Requested Delivery Date",ReqShipDate);
    END;
    
    Procedure - DefineDateFormat: TempDate = String
    CLEAR(intDay);
    CLEAR(intMonth);
    CLEAR(intYear);
    EVALUATE(intDay,COPYSTR(TempDate,1,2));
    EVALUATE(intMonth,COPYSTR(TempDate,3,2));
    EVALUATE(intYear,COPYSTR(TempDate,5,4));
    
    it got the job done. maybe it will give you some ideas...
    kind of fell into this...
  • nc235nc235 Member Posts: 8
    Thank you for the idea!

    I'll try that!

    nc235
Sign In or Register to comment.