Postby GeroL » Wed 11 Apr 2012 23:47


how can I get a function like SqlMethods.DateDiffMinute?

http://msdn.microsoft.com/en-us/library ... 10%29.aspx

I want to select rows where a specified time is over:
DateTime DateTime Int32
DateTime.Now - Row.DateTime > Row.MaxMinutes

I am trying for hours now but it keeps saying that the SqlMethods
are not implemented as you said it is in version 4.xx . :(

Posts: 4
Joined: Wed 11 Apr 2012 23:31

Postby MariiaI » Fri 13 Apr 2012 13:02

We have reproduced the issue. We are investigating it now. We will inform you about the results as soon as possible. As a temporary workaround, you can try using operations with the TimeSpan.
For example, to select rows, where the difference between the dates is more than 60 minutes, use:
Code: Select all
var q = from c in db.Table
        where (c.DateFinish.TimeOfDay - c.DateStart.TimeOfDay) > new System.TimeSpan(0, 60, 0)
        select c;
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SqlMethods.DateDiffMinutes

Postby MariiaI » Tue 29 May 2012 12:57

We have investigated this issue. The DateDiffMinute method (as well as DateDiffMonth, DateDiffSecond and others) is bound to the SQL Server's DateDiff() built-in function, which is not available in other DBMSs (e.g., in PostgreSQL). Thus, we are not planning to support these methods in the nearest future. Instead, you can use the way we have offered you earlier.
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Return to dotConnect for PostgreSQL