Solved

date error adding 28 days

Posted on 2008-11-02
6
197 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:thatelvis
  • 4
  • 2
6 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22862780
how do you use that value in your query?
apart from that, why not use

DATEADD(day, 28, GETDATE())

in your query directly?
0
 
LVL 1

Author Comment

by:thatelvis
ID: 22862839
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
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22862961
that won't work, as the dateadd() function in vbscript and sql is different...

anyhow, that does not show the relevant sql part?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:thatelvis
ID: 22863028
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
0
 
LVL 1

Author Comment

by:thatelvis
ID: 22863046
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
0
 
LVL 1

Author Closing Comment

by:thatelvis
ID: 31512526
thank you
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Prevent site to open without the www. 9 57
Copy only dates 3 70
XML Parsing Classic ASP 5 43
Using querystring in a hyperlink 3 38
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now