Solved

date error adding 28 days

Posted on 2008-11-02
6
201 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
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

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

691 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