Displaying 2 results from an estimated 2 matches for "date_part".
Did you mean:
datapart
2008 Sep 23
3
Finding distinct months using find_by_sql
Hello,
I''m wondering if someone might be able to offer me a solution to the
following problem that has so far stumped me.
I''m trying to get the distinct months (and years) from a date field to
display as a list in a view. For example, there might be a number of
records stored with dates in the table ''headlines'':
name date
record1 21-09-2008
record2
2006 Jul 25
2
Losing precision while copying interval type data (Postgres)
...e interval (Postgres); however, it lose some precision
after I copied that column.
Here is what I did:
@newData.elapsedtime = @oldData.elapsedtime
@newData.save
Result:
both displayed as 00:00:02.453 in the table, however, if I use the
following command to convert its value into float
( SELECT date_part(''epoch''::text, [table].elapsedtime) AS date_part) AS
elapsedtime_sec
The original --> 2.4529983024597
After copy --> 2.453
Is there any way to keep the original value?
Thank you very much!
--
Posted via http://www.ruby-forum.com/.