TOPIC: VB Script to Put a Date on File Disappears

VB Script to Put a Date on File Disappears 09 Jun 2014 20:48 #1592

  • kscott20120
  • kscott20120's Avatar
  • Offline
Under the Save or Email Action there is an area to put a file name. I also want the file name to have yesterdays date so I put the file name plus the VB script for the date with a .pdf at the end.
Ex.
CallRouter Volume Report %{(Right("0" & Month(Date),2) & Right("0" & Day(DATEAdd("d", -1, date())),2) & Year(Date))}%.pdf

This works in Solution Builder and I save the rrd file and close out Solution Builder. When run it again and open the rrd file that has the report, I see that the VB script has been cut off and the report fails to run.

Ex
CallRouter Volume Report %{(Right("0"

Looks like it doesn't like the & and nothing is shown from the & on. Can someone tell me how to correct this?
The administrator has disabled public write access.

VB Script to Put a Date on File Disappears 09 Jun 2014 21:36 #1594

  • aellis
  • aellis's Avatar
  • Offline
I believe we have some sort of an issue using ampersands in VB Script. Can you accomplish the same thing you are looking for with this instead?

%{Date-1}%.pdf
The administrator has disabled public write access.

VB Script to Put a Date on File Disappears 09 Jun 2014 22:10 #1597

  • kscott20120
  • kscott20120's Avatar
  • Offline
We are using the pro version.

This does not work.

Even though it does create the date in the file name, it fails to create the file because the "\" are illegal characters for a file name. The error that comes back is

Could not find a part of the path 'C:\temp\CallRouter Volume Report 6\8\2014.pdf
The administrator has disabled public write access.

VB Script to Put a Date on File Disappears 10 Jun 2014 14:15 #1598

  • aellis
  • aellis's Avatar
  • Offline
I see - ok, how about this:

%{Right("0" + CStr(DatePart("m",Date-1)), 2) + Right("0" + CStr(DatePart("d",Date-1)), 2) + CStr(DatePart("yyyy",Date-1))}%.pdf
The administrator has disabled public write access.
The following user(s) said Thank You: kscott20120