Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem: AddDate roles back year

Status
Not open for further replies.

levi71

Programmer
Jul 1, 2001
5
US
I used the adddate function to add to the date as follows:

newdate = dateadd("yyyy",3,date_primary)
Response.Write &quot;<INPUT TYPE='text' NAME='next_pri_reeval_due' VALUE='&quot; & newdate & &quot;'>&quot;

Here is the value that is returned when I input 1/1/2001 as the date:

12/30/1902

what is wrong?
 
Hello,
When I tried your code I got the same error - something like if you don't supply a date it is the first date known to date type in ASP.
When I did:

date_primary = &quot;1/1/2001&quot;
Response.Write date_primary
newdate = dateadd(&quot;yyyy&quot;,3,date_primary)
Response.Write &quot;<INPUT TYPE='text' NAME='next_pri_reeval_due' VALUE='&quot; & newdate & &quot;'>&quot;

it worked as expected.
Hope this helps.
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top