Jump to content

Recommended Posts

I am just beginning with php/mysql and am looking for help coding this. I need to filter and display certain values from a table if a datediff is more than 182 days.

 

select last name, first name, email from table WHERE DATEDIFF ( DATE1 (date from drop down selection) - DATE2 (date from proj_date column) > 182)

 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/239680-select-from-mysql-using-datediff/
Share on other sites

@xyph thank you very much for your reply! I will test this code tomorrow. I do not have spaces in the column names, I just tried to illustrate the logic and did not worry about syntax since I'm working from a manual for each bit of code. I appreciate your assistance very much.

When he writes an example like this

 

DATE1 (date from drop down selection) - DATE2 (date from proj_date column) > 182

 

It seems like he won't care about negative vales, he only cares if the user input is more than 182 days after, not before.

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.