Link to home
Start Free TrialLog in
Avatar of thatelvis
thatelvis

asked on

date error adding 28 days

Hello,
This is what I have been using for a while and it worked no problem but suddenly it stopped working, I think maybe my host might have configured something.

<% ' adds 28 days to date,
Dim nonactivedate
nonactivedate = DateAdd("d", 28, Now())
 %>


I want to add 28 days to todays date, I am using asp page and a ms 2005 sql database.

is there anything I can do to correct this.

this is the error

"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. "

regards and thank you

k
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thatelvis
thatelvis

ASKER

thank you

using this

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
</head>
<body>
<%= DATEADD(day, 28, GETDATE()) %>
</body>
</html>

I ge this error

Microsoft VBScript runtime error '800a01c2'

Wrong number of arguments or invalid property assignment: 'day'

/a.asp, line 10
that won't work, as the dateadd() function in vbscript and sql is different...

anyhow, that does not show the relevant sql part?
angel thank you

I use dreamweaver and an update behaviour, I have a table with 14 odd columns but it is only the date column on this ocassion needs updating. I would prefer to grab the value from a hidden field as it has always worked before but for the life of me cannot understand what has changed lately.

k
Angel I got it but thank you for been there

<%= (now() + 28) %>

I was using a webassist extension and gosh are they crap sometimes.

hope your well

thanks again

k
thank you