Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting timestamp to day(4) to minute

Status
Not open for further replies.

bablu123

Technical User
Mar 11, 2010
3
US
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
 
The ANSI SQL way is:
[tt]
select * from table
where condition
AND ( ( time1 - time2 ) DAY ( 4 ) TO MINUTE ) >= INTERVAL '0 00:01' DAY(4) TO MINUTE[/tt]

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.
 
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.

 
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
 
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

 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top