Hi,
I am using adapter and I try to do something like this:
select sum((FieldTo - FieldFrom) +1) as test from table group by FkField
Can you tell me how to handle this? Thank you for your help.
Xavier
Use GetScalar(), please check Aggregate functions in scalar queries
Thanks for your quick reply, I checked that already but I am looking for a collection as a result not a int, decimal, ....
Is it possible?
Thanks
I resolve my problem:
fields.DefineField(new EntityField2("Quantity", ((TableFields.FieldTo - TableFields.SetFrom) + 1), AggregateFunction.Sum), 0);
Thanks for your help
But the above query can't result in a collection.
Anyway, glad you have worked it out.