Solved

convert from sybase to oracle

Posted on 2008-10-28
3
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 74

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 74

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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 setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

707 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