Get difference between dates in LINQ-to-Entity

Get difference between dates in LINQ-to-Entity

Postby mars » Mon 12 Oct 2009 07:21

Is there possibility to get difference between two dates in LINQ-to-Entity?

Thanks
mars
 
Posts: 15
Joined: Tue 14 Jul 2009 13:56

Postby AndreyR » Wed 14 Oct 2009 08:54

Unfortunately, there is no way to obtain the difference of two dates in LINQ to Entities.
We will investigate the possibility to implement some solution. I will let you know about the results of our investigation.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Mon 14 Dec 2009 12:20

We have added the DateInterval EntitySQL function to work around this problem.
It will be available in the nearest build.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby wfer » Tue 29 Dec 2009 16:04

Is there an example of using DateInterval function?
wfer
 
Posts: 1
Joined: Tue 29 Dec 2009 15:55

Postby AndreyR » Wed 30 Dec 2009 12:39

This function is available in Entity SQL only.
Here is a sample to get the interval:
Code: Select all
select Devart.Data.Oracle.DateInterval(, ) from

and a sample to use it in the Where method:
Code: Select all
db.Emps.Where("Devart.Data.Oracle.DateInterval(it.FIREDATE, it.HIREDATE) > @p", new ObjectParameter("p", new TimeSpan(30, 0, 0)));

Please note that this functionality will be available only in the next build.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle

Copyright © 1998 - 2017 Devart. All rights reserved.