CAST() functionality

Posts   
 
    
Posts: 1
Joined: 13-Jun-2006
# Posted on: 13-Jun-2006 13:48:32   

Hi, I am wondering if there is any way to do a CAST() with the ORMSupportClasses? The AVG function below is not returning decimal places when it should be (ie returning 2 when it should be 2.7). I have found that if I CAST() the column to a numeric inside the AVG() function in SQL Query analyzer, I can get the correct value. Not sure how to do this with LLBLGen Pro however, or if it is even possible? Any help would be much appreciated, thanks.

IPredicateExpression reviewFilter = new PredicateExpression(); reviewFilter.Add(ReviewFields.BusinessId == bizData.BusinessId); reviewFilter.Add(ReviewFields.ReviewStatusId == (int) ReviewStatusID.Active); object value = _reviews.GetScalar(ReviewFieldIndex.Rating, null, AggregateFunction.Avg, reviewFilter);

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Jun-2006 15:03:40   

I think you may achieve this by implementing IExpression.

Please check the following thread for more details: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3829