Solved

date error adding 28 days

Posted on 2008-11-02
6
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 143

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 143

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Time Conversions...both ways 2 24
Html split(text) Part2 6 23
SQL to JSON 14 39
ASP Error Handler 5 21
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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