当从XML导入数据到Excel时格式化空date

我有一个传统的ASP页面,通过XML生成Excel文件。

Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment;filename=File.xls" 

XML文件标题

 <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office"> <DownloadComponents/> <LocationOfComponents HRef="file:///\\"/> </OfficeDocumentSettings> <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel"> <WindowHeight>12525</WindowHeight> <WindowWidth>15195</WindowWidth> <WindowTopX>480</WindowTopX> <WindowTopY>120</WindowTopY> <ActiveSheet>0</ActiveSheet> <ProtectStructure>False</ProtectStructure> <ProtectWindows>False</ProtectWindows> </ExcelWorkbook> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Bottom"/> <Borders/> <Font/> <Interior/> <NumberFormat/> <Protection/> </Style> <Style ss:ID="s62"> <NumberFormat ss:Format="dd/mm/yyyy;@"/> </Style> </Styles> <Worksheet ss:Name="Sheet1"> <Table ss:ExpandedColumnCount="9" ss:ExpandedRowCount="<%=objRS.RecordCount + 1%>" x:FullColumns="1" x:FullRows="1"> <Row> <Cell><Data ss:Type="String">Date</Data></Cell> </Row> 

然后,对于每一行(只是显示date列的一个例子)

 <Row> <Cell ss:StyleID="s62"><Data ss:Type="DateTime"><% if objrs("DateCol") <> #01/01/1902# then Response.write fncFormatDateXML(objrs("DateCol")) else response.write "" end if %></Data></Cell> </Row> 

fncFormatDateXML将date格式设置为yyyy-mm-dd:T00:00:00.000,如果不是有效的date,则会输出一个空string。

我的问题是,如果一个date单元格是空的,它显示00/01/190,但我想成为一个空单元格。