VoiceGuide IVR Software Main Page
Jump to content

Comparing Dates

Recommended Posts

Hi support team,

 

I'm trying to compare dates which the output will be TRUE if date stored in database is bigger than current date, otherwise is false. I use evaluate expression module to achieve this but I get some error here. Please guide me.

 

084231.446 6 64 22 state [Leader_Qualify1] Evaluate [$RV[Get_Leader_Tablename_enqdate2] >= #$RV_MONTH/$RV_DATE/$RV_YEAR#]
084231.446 6 64 22 rv replace start [$RV[Get_Leader_Tablename_enqdate2] >= #$RV_MONTH/$RV_DATE/$RV_YEAR#]
084231.446 18 64 22 db odbc query completed.
084231.446 6 64 22 rv replace end [8/31/2013 12:00:00 AM >= #7/7/3/2013 8:42:31 AM/2013#]
084231.446 6 64 22 eval [8/31/2013 12:00:00 AM >= #7/7/3/2013 8:42:31 AM/2013#]
084231.447 6 64 22 VGMTYPE_EVALEXPR InvokeMember Eval Exception : Exception has been thrown by the target of an invocation.
084231.447 6 64 22 eval InvokeMember Eval returned
084231.447 6 64 22 rvns add Leader_Qualify1_Input|8/31/2013 12:00:00 AM >= #7/7/3/2013 8:42:31 AM/2013#
084231.447 6 64 22 rvns add Leader_Qualify1|
084231.448 6 64 22 Eval Expr result:[]
084231.448 6 64 22 path {} not found
084231.448 6 64 22 matching path not found [], try boolean paths.

 

 

Share this post


Link to post

You should use DateDiff function.

 

If your dates are in MM/DD/YYYY format then this should work:

 

 

DateDiff("d", "$RV[Get_Leader_Tablename_enqdate2]", "$RV_MM/$RV_DD/$RV_YEAR") <= 0

 

 

and then True/success path will be taken from the Evaluate Expression moudule when $RV[Get_Leader_Tablename_enqdate2] is in future of current time (or same).

 

 

You can use attached VBScript file to test out the DateDiff function for yourself.

fromDate="8/31/2013 12:00:00 AM"
toDate="01/05/2013"

iResult = DateDiff("d",fromDate,toDate)

if iResult < 0 then
  MsgBox "toDate is before fromDate : " & iResult
end if

if iResult > 0 then
  MsgBox "toDate is after fromDate : " & iResult
end if
 
if iResult = 0 then
  MsgBox "same date"
end if

 

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×