Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

I am currently facing an issue while adding no of days in my current date varailbe.
I am using below date,error in bold line:

VB
m_startDate = DateAdd("d",1,date)
m_startTime = "00:00"
'if it is saturday
if Weekday(m_startDate) = 7 THEN
 'm_endDate = DateAdd("d",2,m_startDate)
  m_endDate = DateAdd("d",17,m_startDate)
else
 'm_endDate = m_startDate
<big></big>  m_endDate = DateAdd("d",15,m_startDate)
end if
m_endTime = "23:59"



kindly sugggest how can I add 15 days to the current date .

Thanks.
Posted
Comments
ZurdoDev 7-Apr-15 8:30am    
What's the error?

1 solution

You should check entire code of script, because provided part of it is executing without errors.

So, below code:
VB
m_endDate = DateAdd("d",15,m_startDate)

adds 15 days to m_startDate.
 
Share this answer
 
Comments
chandrayog.2 16-Apr-15 9:35am    
@Mac yes, you are right actually the problem was with server's date format. My script format was yyyy-mm-dd and server's was mm-dd-yyyy. So I changed the format of the date and it ran successfully. Thanks for your response.
Maciej Los 16-Apr-15 13:48pm    
You're very welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900