Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Return minutes as date datatype

Re: Return minutes as date datatype

From: Joel Garry <joel-garry_at_home.com>
Date: 21 Jul 2004 17:26:49 -0700
Message-ID: <91884734.0407211626.83eb581@posting.google.com>


"Mark C. Stock" <mcstockX_at_Xenquery .com> wrote in message news:<G-CdnTYoOqwZL2PdRVn-ug_at_comcast.com>...
> paul, dates is dates -- if you have a date datatype, it will always have a
> date and a time element
>
> so, there is no way to return a date datatype that does not include a date
> element
>
> your best shot is to revamp your generic tool to handle time values
> (returned as number, but perhaps returned as INTERVAL DAY if Access ADO can
> handle that)
>

Am I missing something?

  1* select To_Char(sysdate,'HH24MI') from dual SQL> / TO_C



1725

Seems numeric enough to me?

> ++ mcs
>
> "Paul" <pd_oflaherty_at_nospam.hotmail.com> wrote in message
> news:4NmdnXmGcbWr4WPd4p2dnA_at_brightview.com...
> | Hi,
> |
> | I need to construct an sql statement that will give me just the
> hour/minute
> | portion of a time *as a date*.
> |
> | I have a generic report screen (in Access linked to Oracle via ADO, all
> the
> | SQL statements are passthrough i.e. in Oracle syntax) that allows the user
> | to select a field from a view, then select an expression and finally
> select
> | a value.
> |
> | The list of expressions is determined by checking the ado data type of the
> | field. If the field is numeric or date, then < and > are options. If the
> | data type is text, then they are not (but In, Like, etc are).
> |
> | I can return the hour/minute portion of the date easily enough using
> | TO_CHAR, but this returns the data in text format which is no good for my
> | generic report screen.
> |
> | I handle dates by using Trunc(DateField) - I don't mind if this is being
> | returned as a numeric or a date, just so long as it is not text.
> |
> | I have tried:
> | * DateField-Trunc(DateField) : This just converts to numeric - I need to
> see
> | hour:minute
> | * To_Char(DateField,'HH24:MI') : But this returns a character
> | * To_Date(To_Char(DateField,'HH24:MI'), 'HH24:MI') : But this puts
> | '01/07/2004' in front for the hour/minute part I want
> |
> | I am not overly familiar with Oracle syntax, so hopefully I am just
> missing
> | some kind of date format command, but I'm having a hell of a time trying
> to
> | find it.
> |
> | Thanks
> |
> | Paul
> |
> |
> |
> |

jg

--
@home.com is bogus.
http://www.wired.com/news/mac/0,2125,64286,00.html?tw=wn_tophead_1
Received on Wed Jul 21 2004 - 19:26:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US