Jump to content


< Back to Forum


 

Adding Days To A Date Field


  • Please log in to reply

#1 jiaseby 21 December 2016 - 03:55 AM

After I query a database and get a field that is a date field, I need to add 14 days to it.  Not sure how to do this.  I'm guessing in an evaluate expression, but I'm having no luck.



#2 SupportTeam 21 December 2016 - 07:25 AM

Could you please post VoiceGuide's  vgEngine trace that captures the database query.

 

We can then see in what format the date is returned and can then advise on how 14 days can be added to it.



#3 jiaseby 22 December 2016 - 01:34 AM

Here is the log file.  The result var I'm trying to assign is dateplus14.  You will see this on or about line 093059.897.  you can see the way I tried didn't work.

 

Thanks

 

 



#4 SupportTeam 22 December 2016 - 05:38 AM

No log file was attached. Can you please try attaching the log file again.



#5 jiaseby 24 December 2016 - 02:58 AM

Sorry I thought I attached it.



#6 SupportTeam 24 December 2016 - 03:06 AM

Still nothing attached...

 

Can you try .ZIPing up the file and attaching the .ZIP version ?



#7 jiaseby 24 December 2016 - 06:14 AM

Line 141205:796



#8 SupportTeam 24 December 2016 - 08:21 AM

Trace shows that query:

 

SELECT check, amount,idate,issued FROM Check WHERE check.check=123

 

results in following RVs being set for idate value retrieved:
 

141155.387   4   5   3       rv    add   SQLCheck2_idate|12/21/2016 12:00:00 AM
141155.387   4   5   3       rv    add   SQLCheck2_3|12/21/2016 12:00:00 AM
141155.388   4   5   3       rv    add   SQLCheck2_idate_1|12/21/2016 12:00:00 AM
141155.388   4   5   3       rv    add   SQLCheck2_3_1|12/21/2016 12:00:00 AM

 

$RV[SQLCheck2_3_1]stores the string "12/21/2016 12:00:00 AM" - to which 14 days need to be added.

 

Suggest looking at the VBScript function DateAdd:

 

http://www.w3schools...unc_dateadd.asp

 

please try using a "Run VBScript" module to run the below VBScript and post traces capturing the call.

 

set vg = CreateObject("vgServices.CommandLink")

sNewDate = DateAdd("d",14,"$RV[SQLCheck2_3_1]")

vg.Run_ResultReturn $RV_LINEID, "[NewDate]{" & sNewDate & "}"
set vg = Nothing



#9 jiaseby 27 December 2016 - 05:13 AM

I didn't post the log because it worked perfect.  Thank you.