Apply more than one condition to a find(:all


#1

Hi

I have the find statement below, how can I apply another condition to
this to say AND status > 3

@projectReport = Project.find(:all, :conditions => ‘status != 7’)

Thanks
scott


#2

@projectReport = Project.find(:all, :conditions => ‘status != 7 AND
active = 1’)

scott wrote:

Hi

I have the find statement below, how can I apply another condition to
this to say AND status > 3

@projectReport = Project.find(:all, :conditions => ‘status != 7’)

Thanks
scott


#3

On 6/5/06, scott removed_email_address@domain.invalid wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

:conditions just throws in a WHERE clause.

@projectReport = Project.find(:all, :conditions => ‘status != 7 AND
status > 3’)


#4

On Jun 5, 2006, at 9:10 AM, scott wrote:

I have the find statement below, how can I apply another condition to
this to say AND status > 3

@projectReport = Project.find(:all, :conditions => ‘status != 7’)

@projectReport = Project.find(:all, :conditions => ‘status != 7
and status > 3’)

:slight_smile:


– Tom M.


#5

Sorry, I didn’t see the specific thing you wanted to do

@projectReport = Project.find(:all, :conditions => ‘status != 7 AND
status > 3’)

ryan wrote:

@projectReport = Project.find(:all, :conditions => ‘status != 7 AND
active = 1’)

scott wrote:

Hi

I have the find statement below, how can I apply another condition to
this to say AND status > 3

@projectReport = Project.find(:all, :conditions => ‘status != 7’)

Thanks
scott


#6

thats great,

thanks