February 12, 2007 at 7:08 pm
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
February 14, 2007 at 9:30 am
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
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply