Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get previous days date in MMDDYY format

Status
Not open for further replies.

Steel811

Programmer
Jan 2, 2008
26
0
0
US
Hello,

Does someone know how to get the previous day's date in MMDDYY format? I am writing a script that will move an IIS log from one server to another so my web analytics product can analyze the log. Our logs rotate at midnight, at midnight tonight, our logs will rotate and the new log will be called EX081125.log. I would then run a script to copy the EX081124.log log file over to my web analytics server. Any help would be greatly appreciated!

Thanks,
Sheel
 
A starting point:
MsgBox "EX" & Right(Year(Date-1),2) & Right("0" & Month(Date-1),2) & Right("0" & Day(Date-1),2) & ".log"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top