1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to change date format while exporting as a csv file?

Discussão em 'StackOverflow' iniciado por fdantas, Novembro 30, 2020.

  1. fdantas

    fdantas Administrator Moderador

    I use below code and its working fine. I don't want to change temp table field(dActiveDate) type but please help me to change the date format.

    Note - Date format can be changed by user. It can be YY/MM/DD or DD/MM/YYYY or MM/DD/YY and so on...

    DEFINE TEMP-TABLE tt_data NO-UNDO
    FIELD cName AS CHARACTER
    FIELD dActiveDate AS DATE.

    CREATE tt_data.
    ASSIGN
    tt_data.cName = "David"
    dActiveDate = TODAY
    .
    OUTPUT TO value("C:\Users\ast\Documents\QRF\data.csv").
    PUT UNFORMATTED "Name,Activedate" SKIP.
    FOR EACH tt_data NO-LOCK:
    EXPORT DELIMITER "," tt_data. /* There are more than 15 fields available so using export delimeter helps to have less lines of code*/
    END.
    OUTPUT CLOSE.

    Continue reading...

Compartilhe esta Página