TOPIC: Using VB Scripts in Date Variables.

Using VB Scripts in Date Variables. 09 Jun 2014 21:32 #1593

  • kscott20120
  • kscott20120's Avatar
  • Offline
Using a date parameter instead of a string, the report fails to process.

Conversion from string "" to type 'Date' is not valid

%{DATEAdd("d", -1, date())}%


Start of Range End of Range
%CURRENT_DATE% %CURRENT_DATE% successful
%CURRENT_DATE% 06/10/2014 successful
06/09/2014 %CURRENT_DATE% successful

%{DATEAdd("d", -1, date())}% %CURRENT_DATE% fails
Conversion from string "" to type 'Date' is not valid

%CURRENT_DATE% %{DATEAdd("d", -1, date())}% fails
Conversion from string %CURRENT_DATE% to type 'Date' is not valid

Does a VB script work in a rpt with a date variable ("Start of Rang" "End of Range")?
The administrator has disabled public write access.

Using VB Scripts in Date Variables. 09 Jun 2014 21:45 #1595

  • aellis
  • aellis's Avatar
  • Offline
This might be similar to your other post, but does this simplified code work for you:

%{Date - 1}%

Also, I forgot the disclaimer that VB Script only works in the Pro version. If you are on Logicity free you might be seeing some weird stuff.
The administrator has disabled public write access.
The following user(s) said Thank You: kscott20120

Using VB Scripts in Date Variables. 09 Jun 2014 22:04 #1596

  • kscott20120
  • kscott20120's Avatar
  • Offline
We are using the Pro version. Using %{Date - 1}% does work. I used

Start of Range End of Range
%{Date - 1}% %{Date}%

Thanks for the help
The administrator has disabled public write access.