Search function

  • SQLServerCentral is only for Microsoft SQL Server but you are connecting to an Oracle database!

    You are also using the function "to_date", which is proprietary to Oracle and has a different name in SQL Server.

    Try posting to one of the Oracle related sites, such as http://www.dbasupport.com/ or http://www.dbforums.com

    SQL = Scarcely Qualifies as a Language

  • Since I'm mostly a data troll, I don't know what language you are writing in, but I'll give it a shot even though this is Oracle...  replace the "&" with whatever the correct concatenation character is...

    extract($_POST);

    //to set the date format

    //***************************

    $input1 = date('DD-MM-YYYY h:i:s');

    $input2 = date('DD-MM-YYYY h:i:s');

    $sql= "select TITLE,MAGIC,TIMEREG from title_table

    WHERE MAGIC in ('X', 'Y', 'Z')

    AND TIMEREG >= to_date('" & $input1 & "','DD-MM-YYYY HH24:MI:SS')

    AND TIMEREG<= to_date('" & $input2 & "','DD-MM-YYYY HH24:MI:SS')

    ;"

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply