0

I need to find the difference between two dates in minutes. Here is the select statement I have been using:

 select date ('05.04.2017  11:12:00') - date('now');

It is returning -4 mins -21 secs but I want to see just 4 minutes. I could not find the answer in the ref guide, any idea how to show it in the format I need?

SandPiper
  • 2,816
  • 5
  • 30
  • 52
Andrey
  • 1,629
  • 13
  • 37
  • 65

1 Answers1

5

http://ariel.its.unimelb.edu.au/~yuan/Ingres/us_13229.html

can you give this a shot... not familiar with ingres

select    INTERVAL('mins','today'-date('05.04.2017  11:12:00'))

http://www.r20.nl/TheSQLGuidetoIngres-AppendixB.pdf

RoMEoMusTDiE
  • 4,739
  • 1
  • 17
  • 26
  • Good answer. If the result wanted is simply 4, you could include some extra functions, eg: select abs(int(round(interval('mins',date('2017-01-01 11:55:39')-date('2017-01-01 12:00:00')),0))); – G Jones Apr 19 '17 at 14:16