|
Bob, you can try to modify the sql2xls to handle dates in this way: * Style (date m/d/yy ) ---------------------------------------------- D styleDate S O Class(*JAVA D :'org.apache.poi.hssf.usermodel- D .HSSFCellStyle') D usrFmtDate S 24 Inz('m/d/yy') D styleFmtDate S 5I 0 D Cell_Date S D D Xls_StartDate S D inz(d'1900-01-01') // create Date Style styleDate = createCellStyle(wb); // create a DataFormatter, a User Format and set the Style for Date df = createDataFormat(wb); usrformat = createString(usrFmtDate); usrformat = trimString(usrformat); stylefmtDate = getFormat(df:usrformat); setDataFormat(styleDate:stylefmtDate); // ... Date when SQLTYPE = 384 or SQLTYPE = 385; Cell_Alfa = *blanks; Cpybla(%addr(Cell_Alfa): SQLDATA: 10); if Cell_Alfa = *blanks and not wrt0cell; // do nothing else; cell = createCell(row:c-1); Cell_Date = %date(Cell_Alfa:*DMY); setCellType(cell:0); // type 0=Numeric cell_int = %diff(Cell_Date:Xls_StartDate:*D) + 2; setCellValNum(cell:Cell_Int); setCellStyle(cell:styleDate); // set to date Endif; Regards.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.