Adding 10000+ minute in date field||Interval Function||Date time

Database
New Member

Adding 10000+ minute in date field||Interval Function||Date time

Hi All,

I want to add 9609120 minute to CAST('1988-01-01 00:00:00'  AS TIMESTAMP(6))

when i'm using interval function it's throwing error

 

syntax i used:

 

select  CAST('1988-01-01 00:00:00'  AS TIMESTAMP(6)) + INTERVAL '9609120' minute

Error : Syntax error: Invalid INTERVAL Literal. 

Same Sql syntax is working fine if i use 9999 minute or anything less than 9999.

 Tried with Add month also,it's working fine when (9609120/(60*24)) is whole number ,if any fractions come up it's getting drop 

eg 9609120/(60*24) = 6673 --- working fine for this scenario

 but 9609129/(60*24) - 6673.006 it's neglecting the extra hour and minutes.

 

Please suggest how to go ahead and proceed.

 

Regards,

Amit

1 REPLY
Junior Contributor

Re: Adding 10000+ minute in date field||Interval Function||Date time

As long as it's less than 9999 days:

TIMESTAMP '1988-01-01 00:00:00' + (9609120  * INTERVAL '0000 00:01' day to minute