Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Set Expiry Date


Message #1 by "Sati Bedaysee" <sbedaysee@b...> on Sat, 23 Feb 2002 13:42:25
Dear All:



Can someone please suggest how I would set an expiry date to a member's 

membership and delete them off the system once membership has expired? 

Membership should last for 3 months and after 3 months I want them to be 

automatically deleted off the database. 



Kind regards,



Sati
Message #2 by "Tim Morford" <tmorford@n...> on Sat, 23 Feb 2002 09:44:33 -0500
First off, I would not delete them off the system, I would give them a bit

then if 1 member if 0 non-member and I would use WSH or put a function that

does a datediff on every login example





Function Chk_date(Date_1, Date_2, ID)



'you can also specify day, if

'you want it exact this is just an example

if datediff("m", Date_1, Date_2) > "3" then



sql = "UPDATE Table member = '0' Where ID = '" & ID & "'



chk_date = "0"



Else



chk_date = "1"



End if



End function



That should work, but remember this is only going to see if it has been past

3 mo. I.E. 4/1/02, 7/25/02 will still work, but so will you.



Tim Morford

http://www.aspalliance.com/tmorford





Dear All:



Can someone please suggest how I would set an expiry date to a member's

membership and delete them off the system once membership has expired?

Membership should last for 3 months and after 3 months I want them to be

automatically deleted off the database.



Kind regards,



Sati



Message #3 by "Charles Mabbott" <aa8vs@m...> on Sat, 23 Feb 2002 10:40:08 -0500

Set a field in table for date and one for flag

Lname  	Fname   	Callid	 Renew	 Class	 Show

xxx	Robert	        Kxxxx	4/1/2002  Extra	   1

yyy	Franklin 	Kxxxx	4/1/2002  General  1

zzz 	Michael	        Kxxx	4/1/2000  Extra   -1



the show flag is, after a utility is is ran to set Show

all the -1.  Next an  asp utility comparing current

date against stored date in Renew and if current date

date is less than renew date reset Show to 1.



Now if I chose to display current I have in criteria

looking for > 0  If I want the expired I display  < 0

It should be relatively straight forward then to use

DELETE in the same way..........



Let me know if this helps.

Chuck Mabboott





>From: "Sati Bedaysee" <sbedaysee@b...>

>Reply-To: "Access ASP" <access_asp@p...>

>To: "Access ASP" <access_asp@p...>

>Subject: [access_asp] Set Expiry Date

>Date: Sat, 23 Feb 2002 13:42:25

>

>Dear All:

>

>Can someone please suggest how I would set an expiry date to a member's

>membership and delete them off the system once membership has expired?

>Membership should last for 3 months and after 3 months I want them to be

>automatically deleted off the database.

>

>Kind regards,

>

>Sati












"Racial interaction is described by Physics,

for every action there is an opposite

reaction.  We hate them, they hate us, and

we hate them back. And there you are, we are

trapped by mathematics."

    -Londo B5



http://aa8vs.dhs.org:81/aa8vs





_________________________________________________________________

MSN Photos is the easiest way to share and print your photos: 

http://photos.msn.com/support/worldwide.aspx



Message #4 by "Sati" <sbedaysee@b...> on Sat, 23 Feb 2002 15:45:41 -0000
Thanks Charles for that but I am fairly new to ASP so could you simplify

your response for me??



Thank you!



-----Original Message-----

From: Charles Mabbott [mailto:aa8vs@m...]

Sent: 23 February 2002 15:40

To: Access ASP

Subject: [access_asp] Re: Set Expiry Date







Set a field in table for date and one for flag

Lname  	Fname   	Callid	 Renew	 Class	 Show

xxx	Robert	        Kxxxx	4/1/2002  Extra	   1

yyy	Franklin 	Kxxxx	4/1/2002  General  1

zzz 	Michael	        Kxxx	4/1/2000  Extra   -1



the show flag is, after a utility is is ran to set Show

all the -1.  Next an  asp utility comparing current

date against stored date in Renew and if current date

date is less than renew date reset Show to 1.



Now if I chose to display current I have in criteria

looking for > 0  If I want the expired I display  < 0

It should be relatively straight forward then to use

DELETE in the same way..........



Let me know if this helps.

Chuck Mabboott





>From: "Sati Bedaysee" <sbedaysee@b...>

>Reply-To: "Access ASP" <access_asp@p...>

>To: "Access ASP" <access_asp@p...>

>Subject: [access_asp] Set Expiry Date

>Date: Sat, 23 Feb 2002 13:42:25

>

>Dear All:

>

>Can someone please suggest how I would set an expiry date to a member's

>membership and delete them off the system once membership has expired?

>Membership should last for 3 months and after 3 months I want them to be

>automatically deleted off the database.

>

>Kind regards,

>

>Sati












"Racial interaction is described by Physics,

for every action there is an opposite

reaction.  We hate them, they hate us, and

we hate them back. And there you are, we are

trapped by mathematics."

    -Londo B5



http://aa8vs.dhs.org:81/aa8vs





_________________________________________________________________

MSN Photos is the easiest way to share and print your photos:

http://photos.msn.com/support/worldwide.aspx










Message #5 by "Sati" <sbedaysee@b...> on Sat, 23 Feb 2002 15:46:02 -0000
Thanks Tim for that but I am fairly new to ASP so could you simplify your

response for me??



Thank you!



-----Original Message-----

From: Tim Morford [mailto:tmorford@n...]

Sent: 23 February 2002 14:45

To: Access ASP

Subject: [access_asp] RE: Set Expiry Date





First off, I would not delete them off the system, I would give them a bit

then if 1 member if 0 non-member and I would use WSH or put a function that

does a datediff on every login example





Function Chk_date(Date_1, Date_2, ID)



'you can also specify day, if

'you want it exact this is just an example

if datediff("m", Date_1, Date_2) > "3" then



sql = "UPDATE Table member = '0' Where ID = '" & ID & "'



chk_date = "0"



Else



chk_date = "1"



End if



End function



That should work, but remember this is only going to see if it has been past

3 mo. I.E. 4/1/02, 7/25/02 will still work, but so will you.



Tim Morford

http://www.aspalliance.com/tmorford





Dear All:



Can someone please suggest how I would set an expiry date to a member's

membership and delete them off the system once membership has expired?

Membership should last for 3 months and after 3 months I want them to be

automatically deleted off the database.



Kind regards,



Sati










Message #6 by "Charles Mabbott" <aa8vs@m...> on Sat, 23 Feb 2002 11:35:44 -0500

Sati,



Here is a segment of a page that sets show to -1 then in next pass makes the 

comaparison



<snip>

The purpose of this page is to scan renewal dates and compare them against 

the

actual date and set to past due based on stored date if true.<P>

<center>

<%

  Dim objComm, intNoOfRecords

  Set objComm = Server.CreateObject("ADODB.Command")



  Response.Write "<B>Change all users to noncurrent status </B><BR>"

  objComm.ActiveConnection = strConnect

  objComm.CommandText="UPDATE Members SET Show = -1 "

  objComm.CommandType=adCmdText

  objComm.Execute intNoOfRecords

  Response.Write "This UPDATE command has affected " & _

                   intNoOfRecords & " records<BR><BR>"



' now check the actual date against the stored renewal date



  Response.Write "<B>Compare current date to renew date for user status 

</B><BR>"

  objComm.CommandText="UPDATE Members SET Show = 1 " & _

                      "WHERE (renew - DATE() ) > 0 "



' longer period needed the vaue '0' be altered



  objComm.Execute intNoOfRecords

  Response.Write "This UPDATE command has changed records of  " & _

                   intNoOfRecords & " users to current<BR><BR>"



  Set objComm = Nothing

%>

<snip>



>From: "Sati" Reply-To: "Access ASP" To: "Access ASP" Subject: [access_asp] 

>Re: Set Expiry Date Date: Sat, 23 Feb 2002 15:45:41 -0000

>

>Thanks Charles for that but I am fairly new to ASP so could you simplify 

>your response for me??

>

>Thank you!

>

>-----Original Message----- From: Charles Mabbott [mailto:aa8vs@m...] 

>Sent: 23 February 2002 15:40 To: Access ASP Subject: [access_asp] Re: Set 

>Expiry Date

>

>

>

>Set a field in table for date and one for flag Lname Fname Callid Renew 

>Class Show xxx Robert Kxxxx 4/1/2002 Extra 1 yyy Franklin Kxxxx 4/1/2002 

>General 1 zzz Michael Kxxx 4/1/2000 Extra -1

>

>the show flag is, after a utility is is ran to set Show all the -1. Next an 

>asp utility comparing current date against stored date in Renew and if 

>current date date is less than renew date reset Show to 1.

>

>Now if I chose to display current I have in criteria looking for > 0 If I 

>want the expired I display < 0 It should be relatively straight forward 

>then to use DELETE in the same way..........

>

>Let me know if this helps. Chuck Mabboott

>

>

> >From: "Sati Bedaysee" >Reply-To: "Access ASP" >To: "Access ASP" >Subject: 

>[access_asp] Set Expiry Date >Date: Sat, 23 Feb 2002 13:42:25 > >Dear All: 

> > >Can someone please suggest how I would set an expiry date to a member's 

> >membership and delete them off the system once membership has expired? 

> >Membership should last for 3 months and after 3 months I want them to be 

> >automatically deleted off the database. > >Kind regards, > >Sati >--- 

> >Change your mail options at http://p2p.wrox.com/manager.asp or >to 

>unsubscribe send a blank email to $subst('Email.Unsub').

>

>

>

>

>"Racial interaction is described by Physics, for every action there is an 

>opposite reaction. We hate them, they hate us, and we hate them back. And 

>there you are, we are trapped by mathematics." -Londo B5

>

>http://aa8vs.dhs.org:81/aa8vs

>

>

>_________________________________________________________________ MSN 

>Photos is the easiest way to share and print your photos: 

>http://photos.msn.com/support/worldwide.aspx

>

>

>--- Change your mail options at http://p2p.wrox.com/manager.asp or to 

>unsubscribe send a blank email to $subst('Email.Unsub').

>

>

>--- Change your mail options at http://p2p.wrox.com/manager.asp or to 

>unsubscribe send a blank email to $subst('Email.Unsub').

"Racial interaction is described by Physics,

for every action there is an opposite

reaction. We hate them, they hate us, and

we hate them back. And there you are, we are

trapped by mathematics."

-Londo B5

http://aa8vs.dhs.org:81/aa8vs







_________________________________________________________________

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.



Message #7 by "Sati" <sbedaysee@b...> on Sat, 23 Feb 2002 16:45:55 -0000

Thank you very much will try and digest this!



-----Original Message-----

From: Charles Mabbott [mailto:aa8vs@m...]

Sent: 23 February 2002 16:36

To: Access ASP

Cc: sbedaysee@b...

Subject: [access_asp] Re: Set Expiry Date







Sati,



Here is a segment of a page that sets show to -1 then in next pass makes the

comaparison



<snip>

The purpose of this page is to scan renewal dates and compare them against

the

actual date and set to past due based on stored date if true.<P>

<center>

<%

  Dim objComm, intNoOfRecords

  Set objComm = Server.CreateObject("ADODB.Command")



  Response.Write "<B>Change all users to noncurrent status </B><BR>"

  objComm.ActiveConnection = strConnect

  objComm.CommandText="UPDATE Members SET Show = -1 "

  objComm.CommandType=adCmdText

  objComm.Execute intNoOfRecords

  Response.Write "This UPDATE command has affected " & _

                   intNoOfRecords & " records<BR><BR>"



' now check the actual date against the stored renewal date



  Response.Write "<B>Compare current date to renew date for user status

</B><BR>"

  objComm.CommandText="UPDATE Members SET Show = 1 " & _

                      "WHERE (renew - DATE() ) > 0 "



' longer period needed the vaue '0' be altered



  objComm.Execute intNoOfRecords

  Response.Write "This UPDATE command has changed records of  " & _

                   intNoOfRecords & " users to current<BR><BR>"



  Set objComm = Nothing

%>

<snip>



>From: "Sati" Reply-To: "Access ASP" To: "Access ASP" Subject: [access_asp]

>Re: Set Expiry Date Date: Sat, 23 Feb 2002 15:45:41 -0000

>

>Thanks Charles for that but I am fairly new to ASP so could you simplify

>your response for me??

>

>Thank you!

>

>-----Original Message----- From: Charles Mabbott [mailto:aa8vs@m...]

>Sent: 23 February 2002 15:40 To: Access ASP Subject: [access_asp] Re: Set

>Expiry Date

>

>

>

>Set a field in table for date and one for flag Lname Fname Callid Renew

>Class Show xxx Robert Kxxxx 4/1/2002 Extra 1 yyy Franklin Kxxxx 4/1/2002

>General 1 zzz Michael Kxxx 4/1/2000 Extra -1

>

>the show flag is, after a utility is is ran to set Show all the -1. Next an

>asp utility comparing current date against stored date in Renew and if

>current date date is less than renew date reset Show to 1.

>

>Now if I chose to display current I have in criteria looking for > 0 If I

>want the expired I display < 0 It should be relatively straight forward

>then to use DELETE in the same way..........

>

>Let me know if this helps. Chuck Mabboott

>

>

> >From: "Sati Bedaysee" >Reply-To: "Access ASP" >To: "Access ASP" >Subject:

>[access_asp] Set Expiry Date >Date: Sat, 23 Feb 2002 13:42:25 > >Dear All:

> > >Can someone please suggest how I would set an expiry date to a member's

> >membership and delete them off the system once membership has expired?

> >Membership should last for 3 months and after 3 months I want them to be

> >automatically deleted off the database. > >Kind regards, > >Sati >---

> >Change your mail options at http://p2p.wrox.com/manager.asp or >to

>unsubscribe send a blank email to $subst('Email.Unsub').

>

>

>

>

>"Racial interaction is described by Physics, for every action there is an

>opposite reaction. We hate them, they hate us, and we hate them back. And

>there you are, we are trapped by mathematics." -Londo B5

>

>http://aa8vs.dhs.org:81/aa8vs

>

>

>_________________________________________________________________ MSN

>Photos is the easiest way to share and print your photos:

>http://photos.msn.com/support/worldwide.aspx

>

>

>--- Change your mail options at http://p2p.wrox.com/manager.asp or to

>unsubscribe send a blank email to $subst('Email.Unsub').

>

>

>--- Change your mail options at http://p2p.wrox.com/manager.asp or to

>unsubscribe send a blank email to $subst('Email.Unsub').

"Racial interaction is described by Physics,

for every action there is an opposite

reaction. We hate them, they hate us, and

we hate them back. And there you are, we are

trapped by mathematics."

-Londo B5

http://aa8vs.dhs.org:81/aa8vs







_________________________________________________________________

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.











  Return to Index