Hi All,
I have 2 attributes of TIME data type. I need to find time difftence in seconds, I know DATEDIFF is there but the smallest diifrence is DAY. I want something in minute or seconds.
Any DQL for that? Thanks in advance.
Not sure about DQL, but with DFC, you could do something like this:
IDfTime time = new DfTime("2013-03-01 11:59:10");
IDfTime time2 = new DfTime("2013-03-01 11:59:50");
System.out.println("Difference: " + (time2.getDate().getTime()-time.getDate().getTime())/1000);
You can still use DATEDIFF but in a different way:
select * from dm_sysobject DATEDIFF(day,r_creation_date,r_modify_date) <= (1.0/86400)
I found that DATEDIFF(day, date1, date2) returns the difference between both dates in days, but this difference is to the minute.
SELECT DATEDIFF(day, r_creation_date, r_modify_date) * 60 * 24 FROM dm_sysobject
will return the difference in minutes.
But the results is not to the second, anyone knows how to get the exact result to the second ?