Date formats

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sonnich

    Date formats

    I read this and got confused...

    I use PHP and got this:
    $sql = "delete from blabla where startdate< =
    to_date('2000.0 5.05','YYYY-MM-DD')";
    $result=odbc_ex ec($conn, $sql);

    Result: Warning: odbc_exec() [function.odbc-exec]: SQL error:
    [Microsoft][ODBC SQL Server Driver][SQL Server]'to_date' is not a
    recognized function name.

    to_date should work?

    At the other end i'd like to read out startdate as a date var or format
    it as I need.... (dd.mm.yyyy). Convert makes me confused... help
    please?

    S

  • samuelhon

    #2
    Re: Date formats

    Hi

    to_date is for Oracle

    Pull out the date and do the conversion in php. Let the database do
    data things

    Sam

    On Dec 4, 2:02 pm, "Sonnich" <sonnich.jen... @elektrobit.com wrote:
    I read this and got confused...
    >
    I use PHP and got this:
    $sql = "delete from blabla where startdate< =
    to_date('2000.0 5.05','YYYY-MM-DD')";
    $result=odbc_ex ec($conn, $sql);
    >
    Result: Warning: odbc_exec() [function.odbc-exec]: SQL error:
    [Microsoft][ODBC SQL Server Driver][SQL Server]'to_date' is not a
    recognized function name.
    >
    to_date should work?
    >
    At the other end i'd like to read out startdate as a date var or format
    it as I need.... (dd.mm.yyyy). Convert makes me confused... help
    please?
    >
    S

    Comment

    • lucm

      #3
      Re: Date formats

      I use PHP and got this:
      $sql = "delete from blabla where startdate< =
      to_date('2000.0 5.05','YYYY-MM-DD')";
      At the other end i'd like to read out startdate as a date var or format
      it as I need.... (dd.mm.yyyy). Convert makes me confused... help
      please?
      Checkout the "mssql.datetime convert" option in PHP.INI.

      Regards,
      lucm

      Comment

      • Madhivanan

        #4
        Re: Date formats


        Sonnich wrote:
        I read this and got confused...
        >
        I use PHP and got this:
        $sql = "delete from blabla where startdate< =
        to_date('2000.0 5.05','YYYY-MM-DD')";
        $result=odbc_ex ec($conn, $sql);
        >
        Result: Warning: odbc_exec() [function.odbc-exec]: SQL error:
        [Microsoft][ODBC SQL Server Driver][SQL Server]'to_date' is not a
        recognized function name.
        >
        to_date should work?
        >
        At the other end i'd like to read out startdate as a date var or format
        it as I need.... (dd.mm.yyyy). Convert makes me confused... help
        please?
        >
        S
        You should post at Oracle or Mysql forums

        Madhivanan

        Comment

        Working...