Solved

convert from sybase to oracle

Posted on 2008-10-28
3
370 Views
Last Modified: 2013-12-19
Hai !
        Can someone assist me to convert sybase code to oracle

1. datediff(dd, dateadd(dy,-1,getDate()), dateadd(dy,14,ShipDate) ) < 0
2. datediff(dd, getdate(), dateadd(dd,14,ShipDate) )=0
3.datediff(dd,ReceiptDate,ShipDate)
0
Comment
Question by:vishali_vishu
  • 2
3 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 22826285
all date math in Oracle is in days


1. ( (shipdate+14) - (sysdate-1) ) < 0
2. ( (shipdate+14) - (sysdate) ) = 0
3. (shipdate - receiptdate)
0
 
LVL 11

Expert Comment

by:mohammadzahid
ID: 22826286
Just replace datediff with month_between function in Oracle and getdate with sysdate

dateadd with add_months

goto this site for examples:

http://www.techonthenet.com/oracle/functions/index.php
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 22826319
months_between returns date differences in months, but the datediff examples above are in days.

just use standard arithmetic in Oracle
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question