New Posts New Posts RSS Feed: The argument types 'Edm.Decimal' and 'Edm.Double' are incompatible for this operation??
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

The argument types 'Edm.Decimal' and 'Edm.Double' are incompatible for this operation??

 Post Reply Post Reply
Author
*Calsy View Drop Down
Groupie
Groupie


Joined: 02-Feb-2009
Location: Australia
Posts: 69
Post Options Post Options   Quote *Calsy Quote  Post ReplyReply Direct Link To This Post Topic: The argument types 'Edm.Decimal' and 'Edm.Double' are incompatible for this operation??
    Posted: 29-Apr-2010 at 6:35pm
Thanks. Worked a treat.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 29-Apr-2010 at 4:56pm
I believe the issue is that you need to specify a decimal type for the numeric literals.  In other words, add 'M' after the number.  For example:
c.Longitude > 151.04M
 
Otherwise it treats 151.04 as a double and throws an exception alerting you of a possible information loss due to type precision.
 
Julie Lerman has a good post covering this:
 


Edited by ting - 29-Apr-2010 at 4:59pm
Back to Top
*Calsy View Drop Down
Groupie
Groupie


Joined: 02-Feb-2009
Location: Australia
Posts: 69
Post Options Post Options   Quote *Calsy Quote  Post ReplyReply Direct Link To This Post Posted: 28-Apr-2010 at 1:26pm
Any ideas?
Back to Top
*Calsy View Drop Down
Groupie
Groupie


Joined: 02-Feb-2009
Location: Australia
Posts: 69
Post Options Post Options   Quote *Calsy Quote  Post ReplyReply Direct Link To This Post Posted: 26-Apr-2010 at 5:16pm
Hi, getting the following error when executing a PassthruEsqlQuery:
 
*****************
Caught exception: System.Data.EntitySqlException: The argument types 'Edm.Decimal' and 'Edm.Double' are incompatible for this operation. Near greater than expression, line 1, column 264. at
*****************
 
Here is the query being executed (taken from the log file):
 
*****************
Fetch ... PassthruEsqlQuery: [vwSearchParent] Esql: SELECT Value SearchParent From vwSearchParents as SearchParent Where SearchParent.UserGenreID In (Select Value c.UserGenreID From vwSearchChilds As c WHERE c.UserID <> 27 AND ( c.Field1 LIKE '%a%' ) AND c.Longitude > 151.04 AND c.Longitude < 155.36 AND c.Latitude > -29.43 AND c.Latitude < -25.60)
*****************
 
I can execute the exact same query at the server without error. And also it seem that if i apply the same filtering via an entityquery and execute the entityquery it works without issue.
 
Any help on why this error is occurring with the PassThruEsqlQuery?
 
Thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down