Solved

convert from sybase to oracle

Posted on 2008-10-28
3
378 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe 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 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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 set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

730 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