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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.