Ninjakreborn Posted December 8, 2011 Share Posted December 8, 2011 I have a date in Mysql, which is a field called "created". It is in this format, "20111207045524". I can easily query to see if something is within a specific date range. I can also manage to do any other types of date work I have needed..however, there is one requirement I have never dealt with before. How do I get anything in the database that is 13 days past that date... To give you background...the person has a "Trial" offer...and that trial offer runs for 13 days. What I need to be able to do is tell which people are after their trial..but regardless of the start date. So if they were created on 11/15/2011..then if their account is past 13 days..I need to get that record. I am not sure if I am making much sense...but in essense everyone who has an expired date..I need to get..anyone who has gone more than 13 days past the created date... I can't figure out how to get the calculations correct on the date comparions..maybe it's just a slow moment for me today. Any advice is appreciated. $sql = "SELECT * FROM jp_subscriptions WHERE transaction_type = 'fp' AND created < '" . $last_date . "'"; $query = mysql_query($sql); Last Date, is the current date. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.