search for: begin_date

Displaying 9 results from an estimated 9 matches for "begin_date".

2006 Jan 16
1
Bundled resource -- something I''m missing
...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'' %> I receive the following in my params hash: "begin_date"=>{"date"=>"01/01/2006"}} I constructed a faux model FilterBox just for the occasion, but as you might expect, it can?t be created as easily as you might think because of the trailing ?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'&...
2006 Jan 17
4
find_by_sql column ordering defect?
...mn_name end end sqlstatement = "select id, " + columns.join('', '') + " from projects" @objs = Project.find_by_sql(sqlstatement) the breakpointer tells me that: irb(#<ProjectsController:0x2aaaacb3aa80>):001:0> sqlstatement => "select name, begin_date, projected_end_date, actual_end_date from projects" which is the correct order for the sqlstatement. I then extecute the @objs = Project.find_by_sql(sqlstatement) statement. The ordering of the columns has been altered - thus messing up my headers and the order of the columns: @objs =>...
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 an ez condition that generates this S...
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 02FEB2004:00:00:00:000 01JAN2000:00:00:00:000 02FEB2000:00:00:00:000 01JAN2000:00:00:00:000 02FEB2000:00:00:00:000 Tha...
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 "calendar_events".* FROM "calendar_events" WHERE ("calendar_events"."target_date" BETWEEN 2010-03-29 AND 2010-05-03)[/code] The result is WRONG, because sqlite treats 2010-03-29 as numb...
2006 Feb 28
6
Activerecord equivalent of the SQL "SUM()" function.
...info as above, except a running total of the entire week. Here''s more or less how I''d like to access it (though this returns the first field in a record set, rather than a single, summed record): Report.find(:first, :conditions => "date >= ''" << begin_date << "'' AND date <= ''" << end_date << "'' AND user_id = ''" << @user.id.to_s << "''") As I said, the above just returns the first field of a recordset for the given date range -- not a sum of t...
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