If you want to write your own function well and good ,but simply if you wnat the different of 2 dates just use simple substration in oracle syntax.
ex
select date1-date2 from dual;
if u wnat to write the function both the parameters should be of DATE data type and the return type can be number.
let me more clearify my requirement....
What i actually want is to run the same query on Different DB, since this query is using Oracle - operator does'nt work as required in SQL Server.
select date1-date2 from dual;
What i want is if i write in SQL Server the following query
SELECT DATEDIFF(day, myDATE, GETDATE()) AS NumberOfDays
FROM myTable
This exactly without any change run fine in oracle ... this requires the DATEDIFF function in Oracle which is not there so i want create one for this ... but what about the first parameter of this function
please see detail of DATEDIFF at following link
http://msdn2.microsoft.com/en-us/library/ms189794.aspx
but i cannot under stand what type of this parameter is day dd d
thanks for your co-operation