ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2003, 04:53 PM
zwarte zwarte is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 10 zwarte User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to zwarte Send a message via Yahoo to zwarte
Days left

Hello All,

I have the following. I want to give my users 10 days to access a part of my website. I also want to print the days a user has left in their 10 day subscription. I am using the Day(Now) function to insert 2 numeric values into 2 fields in my DB. A field called StartDate and a field named EndDate. Sometimes the EndDate is smaller than the start day which results in a negative number. Can someone point me in the right direction?

Here is what I am using

Start_Num = Day(Now)
End_Num = Day(Now) + 10

If End_Number > Start_Num Then
Total_Days = End_Num+31-Start_Num
Else
Total_Days = End_Num - Start_Num
End If

If Total_Days < 10 Then
Response.Write("You have" & " " & Total_Days & " " & "days remaining")
Else
Response.Write("Your Days are through")
End If
Comments on this post
JimmyGosling agrees!

Reply With Quote
  #2  
Old January 30th, 2003, 03:33 AM
Mundi Mundi is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 2 Mundi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try looking at the datediff and dateadd funtions, use full dates, that makes it much easier to calculate the number of days left
Comments on this post
JimmyGosling agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Days left

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap