My dates are varchar(50) and appear like this in my database:
2/15/2012
The table looks like this: (Note: someid is not a primary key, its identifies a group)
| someid | date | float_value |
| 1 | 2/15/2012 | 3.2 |
| 1 | 2/15/2012 | 1.4 |
| 1 | 2/15/2012 | 2.1 |
| 1 | 2/16/2012 | 1.8 |
How would I do something like this:
select avg(date), avg(float_value)
where someid = 1
To return something like this:
| date | float_value |
| 2/15/2012 | 2.126 |
Perhaps the answer isn’t average date, but like the date the occurs the most often (in terms of the someid).
Any help would be appreciated from the sql experts.
Thanks in advance
Forget the float nonsense. How about:
In your case you’ll need to convert first. E.g.
This variation may also be useful:
EDIT to present the exact precise and particular formatting that seems to be necessary: