I am trying to check for people in a certain range – let minage and maxage corresponding for e.g. age group with minage=18 and maxage =24 meaning I am trying to filter out the people aged between 18 and 24.Also datatype for dob of member is string ..
i am trying this
int agefrom = Convert.ToInt32(cbGEFrom.Text);
int ageto = Convert.ToInt32(cbGETo.Text);
DateTime today = DateTime.Today;
DateTime max = today.AddYears(-(agefrom + 1));
DateTime min = today.AddYears(-(ageto));
string maxage = Convert.ToString(max);
string minage = Convert.ToString(min);
var members =
from report in eclipse.members
where string.Compare(report.member_Dob,minage) >=0
where string.Compare(report.member_Dob,maxage) < 0
select report;
i dont know is this way is correct or not ..
would any pls suggest any idea ..
many thanks in advance…
EDIT: Query comprehension is as under