<p>I want to compute for month difference of 2 dates which will return a float value.</p>

<p>example:</p>

<p>date1='4/23/2008'
date2='12/31/2008'</p>

<p>that will be 7.y months. I want to find the y value. can someone give me the formula to make this in sql codes? tnx..</p>

There's no standard sql to handle this universally. It depends on what database you're using. Basically, you need to convert the two date strings to the date format your database engine uses internally and subtract the two dates, what the result of the subtraction means will, again, depend. In Oracle, you'd use
```
to_date()
```
for the conversion and the result of the subtraction will be a float representing the time in number of days.
In short, search your db's manual for a section about date handling or data types.