How to compare date from table with variable using db_query?
You are going to need to insure that the format of your $date variable is formatted exactly the same as the format of the date value in your database (field_date_value). For example, if your database is storing its date values in unixtime, then your $date variable needs to be unixtime. If your field_date_value field is storing mm:dd:yy hh:mm:ss, then your $date variable needs to reflect this same format accordingly. Refer to date() to formate your $date variable the appropriate way.

Once you've formatted your $date variable to the same formate of your sql data, you can run a condition method like this:

-&gt;condition("tablename.field_date_value", $date, "&gt;=")


This will query for everything equal to or greater than the specified $date value.