?
Solved

date error adding 28 days

Posted on 2008-11-02
6
Medium Priority
?
202 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 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 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