Id NOT IN (?)

Hi i have 2 table users and issues

I need daily report . all users are give a status to everyday. i got it
2 line.
But i need leave users also.
If i use 1st def method i got user status list and all users no record

when i used the 2 nd def method i got user status list only.

i attached my 2 def methods and the 2 screen shot also here

 def report
         @issues=Issue.find(:all, :conditions => ['DATE(created_on) 

issues =
@issues.each do |iss|
issues << iss.author_id
@users = User.find(:all, :conditions=>“id not in

def report
@issues=Issue.find(:all, :conditions => ['DATE(created_on)

@users = User.find(:all, :conditions => [“id NOT IN (?)”,

can anyone help me thanks for advance

On Sep 15, 2012, at 2:01 AM, daynthan kabilan wrote:

 def report
         @users = User.find(:all, :conditions => ["id NOT IN (?)", @issues])

Try this:

@users = User.where("id NOT IN (?)",

Are you using Rails 2.3 or 3 or 3+? I think the find(:all) is deprecated
after 2.3.


Dear Walter

sorry for the delay reply.

am using rails 2.3.11 am using your condition by

@users = User.find(:all, :conditions=>[“id NOT IN (?)”,])

that time also i got both output

and i got the correct output for this condition.

:conditions=>[“id not in (?)”,issues]

and thanks for your reply.