Jump to content

Anything after 13 days from a date.


Ninjakreborn

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/252772-anything-after-13-days-from-a-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.