CSI Report post Posted 07/07/2004 01:28 PM 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
CSI Report post Posted 07/07/2004 01:47 PM 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
SupportTeam Report post Posted 07/08/2004 02:11 AM 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
CSI Report post Posted 07/08/2004 11:41 AM 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
CSI Report post Posted 07/08/2004 12:04 PM 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
SupportTeam Report post Posted 07/08/2004 05:29 PM 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