naming a file with timestamp

hi,

i want to export to excel or export a text file including timestamp in the name. plz help.



Answer this question

naming a file with timestamp

  • drey

    Another way:

    use myTable
    copy to (alias()+'_'+ttoc(datetime(),1)+'.csv') type csv


  • Carver42

    USE mytable

    * prepare or filter or create a cursor from a query or view with the records to export

    lcFilename = "MyFile_"+Strtran(Strtran(TTOC(DATETIME())," ","_"),":","")

    COPY TO (lcFilename) TYPE XL5


  • naming a file with timestamp