+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

How to get the DATE part of a DATETIME datatype?

  1. Re: How to get the DATE part of a DATETIME datatype?

    In Oracle datetime datatype??? It must be timestamp

    Is this what you want?

    SQL> create table x (datum timestamp);
    Table created.

    SQL> insert into x values (sysdate);
    1 row created.

    SQL> select * from x;
    DATUM
    ----------------------------------------------------
    23-JUN-05 10.29.15.000000 PM

    SQL> select to_char(datum,'DD.MM.YYYY') from x;
    TO_CHAR(DA
    ----------
    23.06.2005

    Sameer

    PWalker wrote:
    > Hi. Sorry I think i posted this message in the wrong forum...
    >
    > I was hoping someone could help me. I am trying to display the time part
    > of a datetime datatype in my query (in this isntance the column containing
    > the datetime datatype is called 'starttime'). How does one accomplish this?
    > I want to see the time via a simple select statement:
    >
    > select starttime from mytable;
    >
    > I was trying to use 'convert' statements, but I wasnt able to get it
    > working. Could someone tell me how to do this? I do not want to start
    > configuring system files as the server is fairly locked down.
    >
    > Could anyone point me in the right direction?
    >
    > Thanks!
    >
    > cheers, peter



  2. Re: How to get the DATE part of a DATETIME datatype?

    In Oracle datetime datatype??? It must be timestamp

    Is this what you want?

    SQL> create table x (datum timestamp);
    Table created.

    SQL> insert into x values (sysdate);
    1 row created.

    SQL> select * from x;
    DATUM
    ----------------------------------------------------
    23-JUN-05 10.29.15.000000 PM

    SQL> select to_char(datum,'DD.MM.YYYY') from x;
    TO_CHAR(DA
    ----------
    23.06.2005

    Sameer

    PWalker wrote:
    > Hi. Sorry I think i posted this message in the wrong forum...
    >
    > I was hoping someone could help me. I am trying to display the time part
    > of a datetime datatype in my query (in this isntance the column containing
    > the datetime datatype is called 'starttime'). How does one accomplish this?
    > I want to see the time via a simple select statement:
    >
    > select starttime from mytable;
    >
    > I was trying to use 'convert' statements, but I wasnt able to get it
    > working. Could someone tell me how to do this? I do not want to start
    > configuring system files as the server is fairly locked down.
    >
    > Could anyone point me in the right direction?
    >
    > Thanks!
    >
    > cheers, peter



  3. Re: How to get the DATE part of a DATETIME datatype?

    In Oracle datetime datatype??? It must be timestamp

    Is this what you want?

    SQL> create table x (datum timestamp);
    Table created.

    SQL> insert into x values (sysdate);
    1 row created.

    SQL> select * from x;
    DATUM
    ----------------------------------------------------
    23-JUN-05 10.29.15.000000 PM

    SQL> select to_char(datum,'DD.MM.YYYY') from x;
    TO_CHAR(DA
    ----------
    23.06.2005

    Sameer

    PWalker wrote:
    > Hi. Sorry I think i posted this message in the wrong forum...
    >
    > I was hoping someone could help me. I am trying to display the time part
    > of a datetime datatype in my query (in this isntance the column containing
    > the datetime datatype is called 'starttime'). How does one accomplish this?
    > I want to see the time via a simple select statement:
    >
    > select starttime from mytable;
    >
    > I was trying to use 'convert' statements, but I wasnt able to get it
    > working. Could someone tell me how to do this? I do not want to start
    > configuring system files as the server is fairly locked down.
    >
    > Could anyone point me in the right direction?
    >
    > Thanks!
    >
    > cheers, peter



  4. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


  5. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


  6. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


  7. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


  8. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


  9. Re: How to get the DATE part of a DATETIME datatype?


    IIRC: Convert is a sqlserver function used to manipulate dates.

    Do not try to apply your knowledge of sql server functions to oracle.
    Go to tahiti.oracle.com and lookup the oracle documentation.
    Specifically read the sql reference and lookup the built in function
    "to_char".

    Anurag


+ Reply to Thread
Page 2 of 2 FirstFirst 1 2