Link to home
Start Free TrialLog in
Avatar of leezac
leezac

asked on

Adding date to Report Export

Is there a way to add Date() to the report name below so that it exports with the date in the name of the report? Like P:\Over_Recal071112.txt"

DoCmd.OutputTo acReport, "rpt_over_recal__totals", acFormatTXT, "P:\Over_Recal.txt"

Thanks in advance.
SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ignore my previous post.  I gave you bum information.  It really should have been:
DoCmd.OutputTo acReport, "rpt_over_recal__totals", acFormatTXT, "P:\Over_Recal" & format(date,"mmddyy") & ".txt"

However; Jeff gave you a better answer especially with regards to the order of the date format.

/Ron
Ron,

You know me, ...as long as my post is noted, that is all I care about.

Besides, you syntax was off a little, but nothing the the OP could not have fixed.
;-)

In the grand scheme of things, you answered to Q as posted.

my posts were just "enhancements/options".
Nothing I posted was proprietary, or groundbreaking.
It is something you or any other expert could have mentioned.

;-)

Jeff
Well Jeff, your "supporting posts" as you described them before, are pretty spot on and very much needed.  Not only by the OP but by other "experts" looking at the question as well.  I myself have gleaned so much info from you and the others here ever since I decided to try seeing if I could bypass EE's membership fee by answering questions.  Thanks for sharing your knowledge!

Ron
Avatar of leezac
leezac

ASKER

Thanks to both of you. I used Jeff's to add the hour and seconds.
leezac,

Yeah, in today's business environment sometimes "Hourly" (or even more frequent) reporting intervals are needed.
In most "date stamp" question I will just include the time by default.

FWIW, There have even been issues with increments down to the seconds, and some members request increments in the milliseconds...!
http://www.devx.com/dbzone/Article/39046/1954
...or for users who like to "lean on" the "Create Report"button...
;-)

To be fair, the format (especially when including the time, will look a bit odd to users just browsing the file list, ("YourFile_20110524062214.txt") but again, the benefit of YYYYMMDDHHNNSS sorting correctly is a major benefit.
Besides you can always concatenate dashes or underscores between the numbers to get something like: YourFile_2011_05_24_06_22_14.txt

;-)

Jeff