>Hi
>I want to export the invoice no and invoice date to the Excel worksheet,
>I set the date to british, the date format is dd-mmm-yyyy,
>the record of the invoice date format in the invoice.dbf is store in mm/dd/yy,
>I find that if the invoice date in invoice file is 5/24/14, the output of the cell is in 24-May-2014, it is dd-mmm-yyyy correct format ,
>but if the invoice date in invoice file is 5/7/14, the output of the cell is still is 05-Jul-2014, I think it should be 07-May-2014.(dd-mm-yyyy)
>why it change ?
>Please advise.
>
>SET DATE BRITISH
>oExcel = CREATEOBJECT([Excel.Application])
>oExcel.SheetsInNewWorkbook = 4
>oWorkbook = oExcel.Workbooks.Add()
>nrow=2
>select invoice
>do while !eof()
> with oExcel.activesheet
> .Range("A"+TRIM(PADR(nrow,11))).value="'"+dtoc(invoice->invno)
> .Range("B"+TRIM(PADR(nrow,11))).NumberFormatLocal ="dd-mmm-yyyy"
> .Range("B"+TRIM(PADR(nrow,11))).value=dtoc(invoice->invdate)
> endwith
> nrow = nrow + 1
> select invoice
> skip 1
>enddo
>
>Thanks.
>Derek
Try it without DTOC()