Add Date within a file name of an exported file

G

Glenda

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.
 
S

storrboy

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?
 
G

Glenda

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?
 
S

storrboy

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"
 
Top