在到处excel文件或者txt文本文件时,通常需要动态生成文件名,这个时候可以使用变量,根据系统提供的函数动态拼接,示例代码如下:

"E://atest//FileName_" + (DT_STR,4,1252) DatePart("yyyy",getdate()) +Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2) + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +Right("0" + (DT_STR,4,1252) DatePart("n",getdate()),2) +".xls"

相关文章:

  • 2022-12-23
  • 2021-10-14
  • 2021-12-06
  • 2022-12-23
  • 2021-06-02
  • 2022-02-05
  • 2022-02-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2021-07-29
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
相关资源
相似解决方案