On Jul 23, 9:05 am, Vlad <vladimir.mcbad...@gmail.com> wrote:
> Hi All,
>
> I have a large number of MS SQL views to change from MS SQL to
> Oracle.  This is fairly simple apart from each view contains a huge
> number of datepart functions.
>
> I am aware that the powerful to_char function can be used as an
> equivalent function to the MS SQL datepart function however it would
> be far quicker to simply use an oracle function that is an equivalent
> of the datepart function.
>
> It would be great not to have to re-invent the wheel....
>
> Is there an Oracle version of datepart available?
>
> Any help would be great.

There are many options, including functions TO_DATE, TO_CHAR:
In Oracle 10g and up you can use EXTRACT
SELECT EXTRACT(DAY FROM sysdate) FROM DUAL;
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions050.htm#SQLRF00639

HTH
Thomas


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to