Date Difference

This is a discussion on "Date Difference" within the Classic ASP section. This forum, and the thread "Date Difference are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 21st, 2003, 17:02
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Date Difference

Thanks a million for all the help so far !

What I'm trying to accomplish here is to show a link if the Todays date is equal to or not more that 10 days for the date the record was added. I have tried tons of combinations of +10, -10 etc and get a script error.

<%
If FormatDateTime(Date(), VbLongDate) =< FormatDateTime(DateAdded, VbLongDate) Then

response.write("Page Background")

Else
response.write "Page Background"

End if
%>

Thanks for all assistance

Ernest L. Kendricks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 21st, 2003, 17:05
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
so... you want only to pick out those dates that are either today... or ten days from now?
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 21st, 2003, 17:20
Junior Member
Join Date: Aug 2003
Location: USA
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
The link "Page Background" is available to user to select a page background for their posting. When each record is added, the table field "DateAdded" is updated. What I'm wanting to do is give the user 10 days from the date they add the original record to either choose, update or change the page background. On day 11, the link would become inactive, preventing any further updates.

Thanks

ELK
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Aug 22nd, 2003, 03:57
vor vor is offline
Junior Member
Join Date: Aug 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Try Using the Function DateDiff. It can tell you the time difference between 2 dates by either Days,Hours,Minues,seconds, etc.

Try something like.
Code: Select all
if DateDiff("d", Date(), "1/1/2000") < 11 then
   Response.Write "WooTWooT"
end if
Double check the Output values, Cause I might have the Date check in flipped. Oh Well.

Full Documentation at:
http://www.devguru.com/Technologies/.../datediff.html

Dont forget to check out VBScript Complete Reference at
http://www.devguru.com/Technologies/...ript_list.html

A LiNK you ShoULD always have on hand. (Also check out WSH Reference Section, Start Coding some of those Nasty email wormz :razz
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Aug 22nd, 2003, 10:19
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,192
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
I was gonna paste the MSDN description but the above is cool.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
date, difference

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
font difference IE7 and the others stupid dog Web Page Design 1 Aug 24th, 2007 20:53
whats the difference acrikey Other Programming Languages 1 Apr 5th, 2007 10:37
The difference moshe Webforumz Cafe 4 Jan 28th, 2007 19:52
Php . asp, asp net difference maksinx PHP Forum 3 Aug 15th, 2006 10:39
Changing date format in date picker AdRock JavaScript Forum 1 Aug 1st, 2006 17:16


All times are GMT. The time now is 15:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42