SqlMethods.DateDiffMinutes

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
GeroL
Posts: 4
Joined: Wed 11 Apr 2012 23:31

SqlMethods.DateDiffMinutes

Post by GeroL » Wed 11 Apr 2012 23:47

Hi,

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

Regards

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Post by 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;

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: SqlMethods.DateDiffMinutes

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

Post Reply