Datestamp a File Name

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

Guest

Is there any way to set a date stamp to a file name? I run the same queries
each morning and would like to send them to a server without overwriting the
previous file. I would like to keep the existing file name but have it add
the date to the name each time the query is run.

Help is appreciated.
 
You should be able to concatenate the date into the file name. You have to
remember to not use characters that aren't legal in file names, for example
you would use 2005-08-07 instead of 2005/08/07. I also recommend the
Year-Month-Date format so that when you sort by file name you'll get the
files in chronological order.

How are you currently supplying the file name?

To get the date in the format listed above,
strFileName & Format(Date(), "yyyy-mm-dd") & ".csv" 'or whatever extension
you use.
 

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