I I build select and where condition against an entity ObjectSet class using
ObjectQuery.
ObjectQuery<DbDataRecord> query = context.TestEnt.Select("it.BuySell, "
+ "it.DepoTerm").Where("Datediff(day,it.RunDateTime,'22-11-2012')=0" );
var a = query.ToList();
foreach (var tmp in a)
{
Console.WriteLine(tmp["BuySell"].ToString());
}
I would like to use datediff function in my where contition ,
How can I do it ?
Try this:
It is possible that you will have to call
CreateDataTimeon your string passed data to make it work. Here is list of all supported date functions in ESQL.You can also use Linq-to-entities: