similar to: Selecting datetime values from SQL Server (year < 1970)

Displaying 20 results from an estimated 5000 matches similar to: "Selecting datetime values from SQL Server (year < 1970)"

2006 Jan 20
47
SQL Server datetime error
i have a problem with the datetime format of rails. i am unable to save a dataset to the db. here''s the error message -- the original error message was in german, so i translated it -- i get: DBI::DatabaseError: Execute OLE error code:80040E07 in Microsoft OLE DB Provider for SQL Server Couldn''t convert a char-Datatype to datetime HRESULT error code:0x80020009
2006 Jul 17
18
Inserting datetime value into SQL Server
I have a SQL Server column named StartTime of (SQL Server) type datetime If I attempt to set the attribute using public def StartTime=(time) write_attribute(:StartTime, "{ts ''1899-12-30 #{time.hour}:#{time.min}:#{time.sec}''}") end it''s inserting a NULL value. Anyone else able to successfully insert a date time value into a SQL Server table using
2006 Jul 14
1
error with Dates in SQL Server
An application that run without flaw last week has been reported to crash with an error that says that a conversion from char to datetime has given a date outside range. This very application runs OK today in production (fortunately :-), and the difference in both SQL Servers is just that the one where the exception has started to appear has Spanish conventions. I can''t give
2006 May 09
9
Working around the year 2038 bug in Ruby''s Time class?
I would have never imagined that I''d be bitten by the Y2038 bug someday... but it just happened and, trust me, it hurts! I have to deal with a database containing datetime fields with dates up to 2050 and more. ActiveRecord raises an exception because Ruby''s Time class implementation. Besides running Ruby on a 64-bit platform, what can be done to avoid that? Does a
2008 Oct 21
6
detecting width overflow in serialized column with mysql
So I''ve got an ActiveRecord model pointing to a MySQL db, with an auto-serialized column ("serialize :columnName"). Thing is, MySQL, depending on how it''s configured (like, by default), has a bad habit of just truncating your data if it''s too wide for the column, with no error raised. Yeah, I can probably reconfigure MySQL and/or my AR connection to it. But
2006 Aug 15
2
has_many + finder_sql & :include
Hello, In a model I have: has_many :things, :finder_sql => '' select * from other_things '' + '' where id = #{id} '' When I do MyClass.find(:all, :include => :things) I get a weird error: from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in
2009 Jun 18
3
Date.new.to_time.to_i
What''s going on here!? >> Date.new.to_time.to_i NoMethodError: undefined method `to_i'' for Mon, 01 Jan -4712 00:00:00 -0800:DateTime from (irb):25 >> Date.today.to_time.to_i => 1245308400 >> RUBY_VERSION => "1.8.7" >> Rails.version => "2.1.1" (I''m not sure if this is a rails thing, or just a ruby thing) --
2009 Jun 09
3
NameError what is it?
I have the following code in app/controllers/processjobs_controller.rb # class ProcessJobsController <ApplicationController def index @ProcessJobs = ProcessJobs.find(:all) end end # This is my route file .. ActionController::Routing::Routes.draw do |map| map.resources :ProcessJobs map.connect '':controller/:action/:id'' map.connect
2012 Jul 05
1
hash to_yaml in erb template not giving valid yaml
Hi, I want to use a file resource to write a facts.yaml file for Mcollective. For some reason it won''t provide a valid yaml format if I dump my scope to hash and convert to_yaml. file { "/etc/mcollective/facts.yaml" : owner => root, group => root, mode => 400, loglevel => debug, #content => inline_template("<%= scope.to_hash.reject {
2008 Mar 20
4
Blank DateTime versus Nil DateTime
Hi! These days I have been having trouble with a test that tried to test DateTime functionality. I have discovered that a NULL DateTime is auto-type casted to NIL by Rails. My problem here is that I have a field :datetime and I want to allow NULL datetimes but not wrong datetimes. With this validation if deadline is wrong or if is is blank it returns true. How I can accomplish this? protected def
2006 Mar 13
2
Connectivity to Microsoft SQL Server using ADO
Based on this page: http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer using this specification development: adapter: sqlserver database: database_name host: server_name username: user_name password: your_pw_here in database.yml for your SQL Server connection doesn''t work. Some debugging code reveals that only the password comes through into
2006 Jun 21
0
SQLServer Timestamp parsing problem in sqlserver_adapter.rb
So, I''ve used Rails to tie into a legacy system which is on SQL Server 2000 with a required timestamp field, DBTimeStamp. The field is defined in SQL Server as type timestamp, but when rails is pulling it in, it appears it may be casting to a datetime format. So, when I try to read or write to the field, it gives me a parsing error: NoMethodError: private method
2008 May 03
11
Date comparisons
I occasionally get this error: 1) ''A puzzle once featured, should no longer be nominated'' FAILED expected: Sun May 04 09:10:26 -0700 2008, got: Sun May 04 09:10:26 -0700 2008 (using ==) ./spec/models/puzzle_spec.rb:180: So, the dates looks the same to me. Any ideas for how to debug? Joe
2007 Sep 24
3
Oracle Date + RoR
Hi Experts, I''ve a model called Product where i''ve column called created_at, updated_at where i''ve made a query based on Oracle date format like date_of_created = ''23-SEP-07'' @product = Product.find(:all, :conditions => ["created_at=?", date_of_created]) but in view its empty. AND EXPERTS I''VE DATA WITH 24-SEP-07 FOR MORE
2006 Jan 09
3
rails ignoring the migration file
I have a mysql database that I am trying to use migrations on. The problem that I am having is that when I create a blob field in my migration file like so: t.column "data", :binary, :limit => 15.megabytes, :null => false rails changes it to this in the schema: t.column "data", :binary, :default => "", :null => false not only is this not what I wanted
2006 Sep 11
0
validates_uniqueness_of :number by the year in a DateTime column
Hello all, I have a class Ticket < ActiveRecord::Base which has a property called :number and a property called :samples_date. a ticket number has to be unique over the same year. the year is given by the property called :samples_date I''m trying to validate the uniqueness of :number based on the year from the :samples_date property. i would like to specify the condition somehow in
2006 Jun 18
4
uninitialized constant Datetime
I am building an application and I have generated the scaffold for a product. In the list method I include something like my_date = Datetime.now and the result I get from the webrick is an error uninitialized constant Datetime Do I have to add a line with a require? I am new at ruby on rails thanks in advance -- Posted via http://www.ruby-forum.com/.
2006 Apr 25
2
DateTime format YYYY-MM-DDTHH:MM:SSZ ????
Hi all - Implementing my first web service with rails and trying things out using the "/controller/invoke" interface. Mostly works fine. But I have a function that takes a datetime and returns all rows that are newer than that. According to the log the SQL it''s generating is this: SELECT * FROM xxxx WHERE (created_at >= ''2006-04-25T13:18:31Z'') I have
2006 Dec 15
1
What's up with DATETIME and TIMESTAMP in Asterisk 1.4beta3 ?
Hello, In Asterisk 1.4 beta 3, the UPGRADE.txt file says: Variables: * The builtin variables ${CALLERID}, ${CALLERIDNAME}, ${CALLERIDNUM}, ${CALLERANI}, ${DNID}, ${RDNIS}, ${DATETIME}, ${TIMESTAMP}, ${ACCOUNTCODE}, and ${LANGUAGE} have all been deprecated in favor of their related dialplan functions. You are encouraged to move towards the associated dialplan function, as these
2001 Apr 09
1
syntax error in datetime.c (PR#901)
Full_Name: Naoki Takebayashi Version: 1.2.2 OS: Linux, RedHat 7.0/alpha Submission from: (NULL) (152.3.12.123) With RedHat 7.0/alpha (gcc 2.96-69), I encountered following error: gcc -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -mieee -O2 -mieee -c datetime.c -o datetime.o datetime.c: In function `do_systime': datetime.c:306: parse error before `ans'