Use this javascript

```
function CalculateDays1() {
t1 = document.getElementById('Fromdate').value;
t2 = document.getElementById('Todate').value;
if (t2 != '' && t1 != '') {
//Total time for one day
var one_day = 1000 * 60 * 60 * 24;
//Here we need to split the inputed dates to convert them into standard format
//for furter execution
var x = t1.split("/");
var y = t2.split("/");
//date format(Fullyear,month,date)
var date1 = new Date(x[2], (x[0] - 1), x[1]);
var date2 = new Date(y[2], (y[0] - 1), y[1])
var month1 = x[0] - 1;
var month2 = y[0] - 1;
//Calculate difference between the two dates, and convert to days
_Diff = Math.ceil((date2.getTime() - date1.getTime()) / (one_day)) + 1;
document.getElementById('TextBoxID-where you want to show calucate day').value = _Diff;
document.getElementById('HiddenFiledID').value = _Diff;
}
}
```

Now just take one hidden field in .aspx page.

```
<asp:hiddenfield id="totDays1" runat="server" xmlns:asp="#unknown" />
```

But I would strongly recommend you to do this in code, not in SQL since it is for data storage not for calculating anything.

Query in solution 2(mine) below will give result as 3 year, 4 month, 11 days, which is the correct difference between the two dates.