assigning SQL date/time value to variable in IVR script

Unanswered Question
Jun 30th, 2010

I am trying to pull a sql date/time value from a Microsoft SQL 2000 database and assign the value to a local variable in an IP IVR script.  I have tried creating both Date and Time variables however when I try to assign the value with DB Get Resource neither one shows up in the drop down menu in CCX script editor.  Do I need to do some data conversion with constructors or such?  Basically what I am trying to do is compare the current date and time to a date and time stored in a database.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
geoff@hp.com Wed, 06/30/2010 - 13:33

Please do a search on this. I know it's come up a few times.

Regards,

Geoff

mydogboris Wed, 06/30/2010 - 13:43

That was the first thing I did however I did not find anything relevant to this situation.  I will however continue to look in the mean time.  Thanks.

mydogboris Wed, 07/28/2010 - 11:46

I figured out the problem.  For those who want to know, when in UCCX Editor you can click on Add New Variable.  When the pop up box appears select any of the available variable types in the list.  We will change this in a moment.  Once you have selected a variable type it will be highlighed in blue.  Go ahead and type in the type of variable you need, in my case it was a java.sql.Timestamp.  I then named it databaseDate and left it at the default value.  Now when i do a database dip I can directly assign the value from the database to the newly created java.sql.Timestamp variable databaseDate.  To compare my database date to the current date I created a new variable of type Date and called it currentDate with a value of new Date().  You can do a direct comparison of type Date with java.sql.Timestamp such as "if (currentDate <= databaseData).  Hope this helps.

geoff@hp.com Wed, 07/28/2010 - 13:17

Exactly. It's not that obvious how to change the type of a variable in Expression Editor, but once you know, you don't forget.

Thanks for the summary. Points deserved and points awarded.

Regards,

Geoff

Actions

This Discussion

Related Content