Page 1 of 1

date sql query

Posted: Thu Mar 05, 2009 12:33 am
by greedyisg00d
I have a schedule table and it has 3 fields by default namely e_name, date_from, date_to. For example

e_name = greedyisgood
date_from = 2009/03/05
date_to = 2009/03/10

In my search page I have 2 fields date_from and date_to. What I want is when the user sets a date in the search for example.

date_from = 2009/03/01
date_to = 2009/03/06

The record of greedyisgood will not be shown since he has already a schedule on the date entered by the user.

Any sample query so that I can try it. Thanks

Re: date sql query

Posted: Thu Mar 05, 2009 7:42 am
by CanMikeF1
I'm not really clear on what your asking but if you mean you would like a select statement that returns all records but excludes any records by e_name = greedyisgood then:

select * from table where e_name != 'greedyisgood';

The conditional '!=' means not equal to.

Is this what your want?