date problem

  • Thread starter Thread starter waynez
  • Start date Start date
W

waynez

Hi
I have a need to import a dbase file each morning into an existing access
database, The dbase file name is a combination of "AC" plus the date. IE
AC040122.dbf.
I want to use code in a modual to automatically search for yesterdays dbase
file and import it and later append it. Right now I am stuck on the date
format. I used "AC"& now()-1 &".dbf" and got an error message. Obviously
the format is incorrect. How would I get 1/22/2004 to look like 040122? Any
help would be greatly appreciated
 
"AC" & Format(Date()-1,"yymmdd") & ".dbf"

You can use the Format function to rework the date format. Note that Date
function returns just the date; Now returns the date and time.
 
Back
Top