×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

converting timestamp to day(4) to minute

converting timestamp to day(4) to minute

converting timestamp to day(4) to minute

(OP)
Hi guys,
Iam converting teradata sql to Pl/sql
In teradata i have
select * from table
where condition
AND ( ( time1 - time2 ) DAY ( 4 ) TO MINUTE  ) >= '0 00:01.

so the above query has to work in oracle

can any one help me out

thanks in advance

RE: converting timestamp to day(4) to minute

ANSI SQL is probably not going to help you, i suggest you post your question in an oracle forum

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon

RE: converting timestamp to day(4) to minute

The ANSI SQL way is:

select * from table
where condition
AND ( ( time1 - time2 ) DAY ( 4 ) TO MINUTE  ) >= INTERVAL '0 00:01' DAY(4) TO MINUTE


But, as r937 already said, you'd better ask this question in an Oracle forum. Date/time handling is one of the worst areas when it comes to ANSI compliance. Too many vendors have their own, non-standard, implementations.

RE: converting timestamp to day(4) to minute

(OP)
Actually when i try to use day(4)to minute in Oracle Pl/Sql it won't work

But iam gone with day(4)to second like this

AND ( ( time1 - time2 ) DAY ( 4 ) TO SECOND  ) >= '0 00:01:60.

iam not sure this is the way doing.

 

RE: converting timestamp to day(4) to minute

I think you want this

CODE

select * from table where ((time1 - time2) DAY TO SECOND) >= interval '+00 00:01:00' day to second

-----------------------------------------
I cannot be bought.  Find leasing information at http://www.joshaxtell.com/

RE: converting timestamp to day(4) to minute

(OP)
Hi Jaxtell

actually in teradata we donot use INTERVAL
we just
 ( ( time1 - time2 ) DAY ( 4 ) TO MINUTE  ) >= '0 00:01.


i think it will work.
can you explain me why you are using interval..

( ( time1 - time2 ) DAY ( 4 ) TO SECOND  ) >= '0 00:00:60.'

you can check teradata query here

http://www.teradataforum.com/l081007a.htm

RE: converting timestamp to day(4) to minute

I'm using oracle.  Isn't that what you're trying to convert to?  My understanding is that by specifying interval I am making an explicit conversion instead of an implicit one.  But it will probably work without specifying interval since you can use the default day and seconds precision on the right side.

-----------------------------------------
I cannot be bought.  Find leasing information at http://www.joshaxtell.com/

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close