Serializing a file name by datetime

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

Guest

I'm creating a backup routine for a database. Due to the need for 24/7
access, the best I can do at the moment is to use FILECOPY. Here's the
problem: I have a requirement to serialize by the date and time of the
backup. Here's what I have:

DFile = "\\serverloc\application\Backups\SEbak_" & _
Format(Now(), "dd") & "-" & Format(Now(), "mm") & "-" & _
Format(Now(), "yy") & "_" & Format(Now(), "hh") & _
Format(Now(), "???") & Format(Now(), "ss") & ".mdb"

The question marks indicate the problem area. "min" returns the month
number, the letter "i", and something or the other else. How do I return the
minutes portion of a datetime value?
 
Use n for miNutes.

Try:
Format(now(), "dd\-mm\-yy\_hhnnss") & ".mdb"

The backslash indicates the next character is a literal.
 
Boy is my face red - found the details of the custom formats in the Access
Help just before returning...however, your solution is much cleaner. Thanks!
 

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