Jump to content

WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) Need an END DATE suggestion please


0o0o0
Go to solution Solved by Ch0cu3r,

Recommended Posts

I have this below ive used it for a couple years..

$query = "SELECT * FROM `table` WHERE date > DATE_SUB(NOW(), INTERVAL 1 
MONTH)  ORDER BY Date DESC";

Works great .. but I would like to add an ending date to it..   i've tried the below way and it works ...but I like how the above would dwindle down slowly to showing less and less information by the following month or set date.. 

$query = "SELECT * FROM `table` WHERE date BETWEEN '2015-06-19' AND '2015-08-01' 
ORDER BY Date DESC";

Need something added to WHERE date > DATE_SUB(NOW(), INTERVAL 1 MONTH) (example stop showing anything after '2015-08-01' or set future date.)

 

so the viewer slowly stops seeing june 19 tomorrow.. june 20 next day.. less and less... that by September 1st the user has to contact me by phone or email because they have nothing left to see.

Thanks

Edited by 0o0o0
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.