Re: [PHP-DB] Date Control Problem
Hello, "Ian"! You wrote: > Case 1: > Now, I would like to display all data from Test table > where my due_date is > before the current date. due_date LESS THAN now() > Case 2: > Same as case 1, I > would like to display all data from Test table where > expired_day plus > posting_date is before the current date. Try: posting_date + expired_day < now() -- Piloteers do it on the road -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Date Control Problem
Try SELECT * from Test where due_date >= now(); -Jim - Original Message - From: "Ian" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 11, 2001 8:59 PM Subject: [PHP-DB] Date Control Problem > Dear Sir / Madam, > > Case 1: > My database, > Table name -> Test. > Field name -> due_date. > > Let say, > due_date = 2001-01-01. > > Now, I would like to display all data from Test table where my due_date is > before the current date. I tried the below SQL statement but it didn't work, > SELECT * from Test where due_date >= curdate(); > My display result should be zero. > Any good solutions or suggestions for Case 1? > > > Case 2: > My database, > Table name -> Test. > Fields name -> posting_date, and expired_day. > > Let say, > posting_date = 2000-12-20 > expired_days = 14 days > > So my due date is 2001-01-02(from my own calculation). Same as case 1, I > would like to display all data from Test table where expired_day plus > posting_date is before the current date. > My display result should be zero. > Any good solutions or suggestions for Case 2? > > Thanks in advance. > > > Best Regards, > Ian. > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Date Control Problem
MYSQL Leonard Tambunan <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > What is the Database Engine? > > > Dear Sir / Madam, > > > > Case 1: > > My database, > > Table name -> Test. > > Field name -> due_date. > > > > Let say, > > due_date = 2001-01-01. > > > > Now, I would like to display all data from Test table where my due_date is > > before the current date. I tried the below SQL statement but it didn't work, > > SELECT * from Test where due_date >= curdate(); > > My display result should be zero. > > Any good solutions or suggestions for Case 1? > > > > > > Case 2: > > My database, > > Table name -> Test. > > Fields name -> posting_date, and expired_day. > > > > Let say, > > posting_date = 2000-12-20 > > expired_days = 14 days > > > > So my due date is 2001-01-02(from my own calculation). Same as case 1, I > > would like to display all data from Test table where expired_day plus > > posting_date is before the current date. > > My display result should be zero. > > Any good solutions or suggestions for Case 2? > > > > Thanks in advance. > > > > > > Best Regards, > > Ian. > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Date Control Problem
What is the Database Engine? > Dear Sir / Madam, > > Case 1: > My database, > Table name -> Test. > Field name -> due_date. > > Let say, > due_date = 2001-01-01. > > Now, I would like to display all data from Test table where my due_date is > before the current date. I tried the below SQL statement but it didn't work, > SELECT * from Test where due_date >= curdate(); > My display result should be zero. > Any good solutions or suggestions for Case 1? > > > Case 2: > My database, > Table name -> Test. > Fields name -> posting_date, and expired_day. > > Let say, > posting_date = 2000-12-20 > expired_days = 14 days > > So my due date is 2001-01-02(from my own calculation). Same as case 1, I > would like to display all data from Test table where expired_day plus > posting_date is before the current date. > My display result should be zero. > Any good solutions or suggestions for Case 2? > > Thanks in advance. > > > Best Regards, > Ian. > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]