Jump to content


< Back to Forum


 

Sql


  • Please log in to reply

#1 jiaseby 16 December 2016 - 08:46 AM

I'm trying to do a insert into a table.  I need to store a date field.  What is the best way to get the date from Voiceguide that will work in the insert sql command?



#2 SupportTeam 16 December 2016 - 08:53 AM

Do you know in what format your database expects the date/time expression to be provided to it as part of the SQL statement?

 

Current Date/Time values can be obtained/built using these Result Variables ($RVs).

 

from http://www.voiceguid...ltvariables.htm :

Current Date/Time Result Variables

$RV_WEEKDAY

Takes on a value between 1 and 7, depending on what day it is. 1 is a Monday and 7 is a Sunday. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the day of the week.


$RV_DD

Takes on a 2 digit value between "01" and "31", depending on what day of the month it is. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on what day of the month it is.


$RV_MM

Takes on a 2 digit value between "01" and "12", depending on what month it is. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the current month.


$RV_YY

Takes on a 2 digit value of current year (eg: "03"). Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the current year.


$RV_HH

Takes on a 2 digit value between "00" and "23", indicating the hour of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.


$RV_NN

Takes on a 2 digit value between "00" and "59", indicating the minute of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.


$RV_SS

Takes on a value between "00" and "59", indicating the second of the current time. Can be used in Evaluate Expression modules to allow you to switch to different areas on the script depending on the time of day.


$RV_MS

Takes on a value between "000" and "999", depending on the millisecond fraction of the current time.


Other Time Related RVs

The following $RVs are also available. They are pretty self-explanatory:

$RV_MONTHNAME, $RV_HOUR, $RV_MINUTE, $RV_SECOND, $RV_TimeStamp_Long, $RV_TimeStamp_Short, $RV_DateStamp_Long, $RV_DateStamp_Short $RV_MONTH, $RV_YEAR, $RV_DATE

eg. use this expression to create a date and time 'timestamp' :

$RV_YY$RV_MM$RV_DD$RV_HH$RV_NN$RV_SS.$RV_MS