.net - Date compare condition not working in Entity Framework 5 query - Code First - DB2 database -
i'm using entity framework 5 connect db2 database (code first).
i'm attempting perform simple comparing between 2 dates status clause:
using (mew_context context = new dataaccess.mew_context()) { var query = context.milist.asqueryable(); datetime today = datetime.today; datetime lastsunday = datetime.today.adddays(-(int)datetime.today.dayofweek); query = query.where(i => lastsunday != today && lastsunday <= i.scheduledate); }
generated sql:
select extent1.item_no item_no testdb2.vls_miss_inst_sum extent1 (@p__linq__0 <> @p__linq__1) , (@p__linq__2 <= extent1.sch_date)
i receive next error:
innerexception = {"error [42609] [ibm][db2] sql0417n statement string prepared contains parameter markers operands of same operator."}
i noticed generated sql did not wrap status singular statement evaluated.
does have advice on how can date compare status work? help much appreciated, thanks.
i don't know you're trying accomplish by
lastsunday != 1-1-0001
because does.
it's plenty sec comparing because lastsunday
never more 7 days ago , have value.
apparently, db2 query provider doesn't allow operand operate on 2 external variables, on database columns , variables.
.net db2 entity-framework-5
No comments:
Post a Comment