Add Date within a file name of an exported file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to export a query to excel and be able to add the current date
in the name of the file everything the file is exported.
 
I would like to export a query to excel and be able to add the current date
in the name of the file everything the file is exported.


So what help are you asking for?
 
I've used the OutputTo in a macro. I want the name of my Output File to be
for example
I:\LongHaulFreight\TruckSchedule2007-03-12.xls
Can I put something in the output file line to accomplish this?
 
I've used the OutputTo in a macro. I want the name of my Output File to be
for example
I:\LongHaulFreight\TruckSchedule2007-03-12.xls
Can I put something in the output file line to accomplish this?

Use the syntax...
[file path/filename] & Format(Date(),"[format string]") & ".xls"

Example
I:\LongHaulFreight\TruckSchedule" & Format(Date(),"yyyy-mm-dd") &
".xls"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top