Forum Moderators: coopster & phranque

Message Too Old, No Replies

fetch data from a specific date onward

"> or =" in a select query

         

Mitch888

1:43 am on Mar 6, 2003 (gmt 0)

10+ Year Member



I have a table called "users" and it has a field called "join_date"
and
I have a table called "clubs" and it has a field called "c_date"

My question:

How can I select all data in table "clubs" from the "join_date" onward

or how can I re-write the following statement and change the "=" to ">="
$sql="Select *from clubs inner join users on clubs.c_date=users.join_date where user_id ='$user_id'";

thank you

jatar_k

4:44 am on Mar 6, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try

Select *from clubs inner join users on clubs.c_date=users.join_date where user_id ='$user_id' and users.join_date > 'somedate'

you can use AND in your where clause to set multiple where criteria

Mitch888

6:07 am on Mar 6, 2003 (gmt 0)

10+ Year Member



that worked pretty good. I don't know why I never thought of that.

Thank you, you're a life saver