Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Help....

Status
Not open for further replies.

donm1021

Programmer
Nov 26, 2001
1
US
I have a Membership database and I trying to write a MySQL query that will print a message out to the screen when a member logs in to let them know that their membership is about to expire within the next 30 days.

I have a field called "date_exp" which contains each members membership expiration date. How do I compare once they login, their expiration date (date_exp) against the current date and determine if their membership will expire within the next 30 days and then print a message out to the screen in HTML?

Any help in getting me started in the right direction would be much appreciated.

 
try something like this
select TO_DAYS(date_exp)-TO_DAYS(NOW()) FROM table
that should return the number of days remaining
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top