Displaying 11 results from an estimated 11 matches similar to: "find_by_sql column ordering defect?"
2006 Mar 09
4
sort-weirdness - active record issue?
I''m selecting data into a controller and sorting it. The code (in the
controller) looks like this:
def index
@assignments = []
tasks = Task.find(:all, :conditions => ["person_id = ? and
actual_end_date is null", session[:user].id.to_s ])
issues = Issue.find(:all, :conditions => ["person_id = ? and status
<>
2012 Nov 23
3
read.csv.sql() to select from a large csv file
Dear list,
Dear list,
I am using read.csv.sql() from the sqldf package to read
individual-based data from a csv file that is too large for R.
My original file contains a column called “ID” that
identifies the individual. I would like to read in data for only
one individual at a
time, for example "Bobby".
read.csv.sql("filename",sql = 'select * from file where ID =
2004 Nov 02
2
A little more on R, mdbtools and Access databases
Hi again,
I have played a little more with mdbtools and R. I downloaded the
latest version of mdbtools from sourceforge (version 0.6pre1). Quickly
scanning the mailing list suggests that ODBC seems to work with PHP
but I have not been able to get it to work with R. I can make a
connection to the database and when I do a query I get back the names
of the rows but not the data. I must admit I have
2006 Jan 16
1
Bundled resource -- something I''m missing
I have a decoupled form embedded in my pages ? a search box that has date
fields ? and of course the search fields are not in my model. However,
picking dates is a great use for the Dynarch calendar. It seems that by
using the syntax:
<%= render :partial => ?filter_box? %>
In my view and...
<%= dynarch_date_select ''filter_box'', ''begin_date'' %>
2006 Dec 11
1
Compute date during before_validation_on_create
Hello,
- the form posted by the user have a date field
- this date is begin_date, I need to compute end_date
- so, added callback before_validation_on_create
- in this method I do :
end_date = begin_date >> 12
- unfortunately, beeing in before_validation the actual self.begin_date
have not been type casted - It''s always a string
- unfortunately again, I can''t put this code
2008 Oct 14
4
replace_html not working
hallo, everyone
can anybody help me? i did add my code under ENGINES as a module in a
project. before the change , all worked . and the differenz between
both is only about application''s environment,
before is
Ruby version 1.8.6 (i486-linux)
RubyGems version 1.1.1
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2
2006 Apr 18
3
ez_where query question
I''m having fun composing queries with ez_where, but am stuck on how to
formulate the following using the ez syntax:
(begin_date >= ? OR end_date >= ?) AND (description LIKE ? OR name LIKE ?)
There are two clauses, each containing OR operators (the ez ''any'' syntax)
but both clauses must evaulate to true for a match.
Can anyone suggest the proper way to construct
2012 Jul 10
1
calculating the difference between days?
Hi List,
I have one column of beginning dates and one column of ending dates, I want
to find their difference. And I want to ignore the trailing zeros,
basically everything after the first colon mark.
Begin_date End_date
01JAN2000:00:00:00:000 02FEB2002:00:00:00:000
24MAR2012:00:00:00:000 18MAY2012:00:00:00:000
01OCT2003:00:00:00:000
2010 Mar 31
0
Date format in Rails 3.0 using sqlite3
Hi,
I am new to Ruby and Rails, so I don''t know if this is my fault, but
maybe this is a bug in Rails (I''m using Rails 3.0 beta) which should be
reported.
I have following search statement:
[code]events = CalendarEvent.find :all, :conditions => { :target_date =>
begin_date..end_date }[/code]
which produces following sqlite output:
[code]SELECT
2006 Feb 28
6
Activerecord equivalent of the SQL "SUM()" function.
Search doesn''t seem to be working, so forgive me if I''m covering old
ground here, but I''m having a difficult time figuring out how to
implement a "SUM()" function using Active record. Obviously, I could
just create a query, but I''d rather make it part of my active record
object.
Basically I have an object called "Report <
2006 Feb 09
17
complicated finds are eating my sole
I abandoned ruby way for find_by_sql and still can''t get this...
@myplacement = Placement.find_by_sql(
"select * from placement where
:intake_date >= beg_intake_date
and
:intake_date <= end_intake_date")
just a simple date range...it''s killing me - If I knew how to load
placement controller into irb, I could probably try out finds
interactive mode...
Thanks