Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBScript - Increasing a variable's value

Tags:

vbscript

I have the following:

firstDate = InputBox("Insert the first report's date desired to obtain", "Report Information - Start", "YYYY-MM-DD")

So the user inserts the date, lets say: 2015-04-17

I am trying to find a way by which I can increase the date's value for a specific position (day->DD), for example:

dateIncrease = Mid(firstDate, 9, 2)+1

I am expecting the above to return 18 (17+1)

How can I increase the value of the date? Please help. Let me know if I wasn't clear enough. Thanks.

like image 226
F0l0w Avatar asked Dec 02 '25 01:12

F0l0w


1 Answers

This is what you're looking for:

firstDate  = "2015-04-17"
dateIncrease = DatePart("d", DateAdd("d", 1, DateValue(firstDate )))
like image 117
Uri Goren Avatar answered Dec 06 '25 08:12

Uri Goren