ببخشید الان این dbo.agec که نوشتید چی هست؟ یک store procedure است؟
من تابع محاسبه سن رو با C# نوشتم
البته هنوز کامل نیست
public static int Age_caculate(string birthdate)
{
char[] sep = { '/' };
PersianCalendar ps = new PersianCalendar();
string date = ShamsiDate.GetFarsiDate(DateTime.Now, true);
string[] arrDate = date.Split(sep);
int month = Convert.ToInt32(arrDate[1]);
int day = Convert.ToInt32(arrDate[2]);
int year = Convert.ToInt32(arrDate[0]);
string[] birthDate = birthdate.Split(sep);
int birthmonth = Convert.ToInt32(birthDate[1]);
int birthday = Convert.ToInt32(birthDate[2]);
int birthyear = Convert.ToInt32(birthDate[0]);
int agy;
int agm;
int agd;
int age;
agy = year - birthyear;
agm = month - birthmonth;
agd = day - birthday;
if (((agm == 0) && (agd < 0)) || (agm < 0))
age = agy - 1;
else
age = agy;
return age;
}
این دستور select ای نوشتید رو من کجا باید بنویسم؟
میشه کامل توضیح بدید من در sql تازه کارم