VoiceGuide IVR Software Main Page
Jump to content

Date Evaluations

Recommended Posts

I have many different lines coming into my VoiceGuide system. I differentiate each line by identifying the DNIS, accessing a database, and running the appropriate script.

 

I'm having trouble evaluating dates returned from the database. I need to compare the current date with the Open Date and Close Date of the line, to determine if the line is supposed to be active.

 

Here is what I have now in an evaluation module:

 

$RV[Query DNIS DB_18_1] <= $RV_MONTH/$RV_DATE/$RV_YEAR <= $RV[Query DNIS DB_19_1]

 

When run, it translates to this:

[Active_Input]{7/12/2004 <= 7/7/2004 <= 12/31/9999}[Active]{True}

 

Obviously, 7/12/2004 is not less than or equal to 7/7/2004, so this evaluation should have returned a false. What am I doing incorrectly?

Share this post


Link to post

Okay, I got the above evaluation to work by changing it to:

 

$RV[Query DNIS DB_18_1] <= $RV_MONTH/$RV_DATE/$RV_YEAR and $RV_MONTH/$RV_DATE/$RV_YEAR <= $RV[Query DNIS DB_19_1]

 

 

However, many of my other lines started failing:

 

084219.12 15 AddRVns [Active_Input]{4/24/2004 <= 7/7/2004 and 7/7/2004 <= 12/31/9999}

084219.13 15 AddRVns [Active]{False}

084219.13 15 Eval Expr result:[False]

Share this post


Link to post

I'm not too sure if you can compare dates like this...

I think that you may be comparing results of divisions...

 

Have you tried using the "Date/Time Switch" module instead?

Share this post


Link to post

I don't see where you can use RVs within a Time Switch.

 

I would need to compare the current date to two RV values.

 

This would actually be a big help because my next evaluation compares the time and checks to make sure that the line is open when the call comes in, I also have another evaluation that checks for Day of Week, so if I could use a Time Switch it would certainly be a big help.

Share this post


Link to post

Okay. I played around with it a little more and found something that worked. If you encase your date values with # symbols, it seems to recognize it as a date.

 

I used:

#$RV[Query DNIS DB_18_1]# <= #$RV_MONTH/$RV_DATE/$RV_YEAR# and #$RV_MONTH/$RV_DATE/$RV_YEAR# <= #$RV[Query DNIS DB_19_1]#

 

which, for a program scheduled to start on 7/12, translates to:

065020.26 16 .Eval(#7/12/2004# <= #7/8/2004# and #7/8/2004# <= #12/31/9999#)

065020.27 16 AddRVns [Active_Input]{#7/12/2004# <= #7/8/2004# and #7/8/2004# <= #12/31/9999#}

065020.27 16 AddRVns [Active]{False}

 

and for another line that opened yesterday

065450.51 17 .Eval(#7/7/2004# <= #7/8/2004# and #7/8/2004# <= #12/31/9999#)

065450.51 17 AddRVns [Active_Input]{#7/7/2004# <= #7/8/2004# and #7/8/2004# <= #12/31/9999#}

065450.52 17 AddRVns [Active]{True}

065450.52 17 Eval Expr result:[True]

Share this post


Link to post

Thanks for the tip about using # around the dates to make the date expression recognized as an actual date. We might add this example to the VG Help file itself...

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
×