SQL Query with "BETWEEN" and "SUM"

I have SQL Query:

SELECT SUM(decimal_field) AS Summ
FROM table_name
WHERE (datetime_field BETWEEN '01/01/2006' AND '02/28/2007')

So, how can I convert it in DLINQ query?

[198 byte] By [Yachtsman] at [2007-12-30]
# 1

DateTime date1 = ...;
DateTime date2 = ...;

var sum = (from row in table
where row.datatime_field >= date1 && row.datetime_field <= date2
select row).Sum(r => r.decimal_field);

MattWarren-MSFT at 2007-10-10 > top of Msdn Tech,Visual Studio Orcas,LINQ Project General...

Visual Studio Orcas

Site Classified