|
Posted by ZeldorBlat on 03/15/07 19:47
On Mar 15, 2:47 pm, Eugene Anthony <solomon_13...@yahoo.com> wrote:
> I have a table that has a DateTime column which uses a DataTime
> datatype. How do I retrieve the minimum and maximum year using ms sql?
>
> Eugene Anthony
>
> *** Sent via Developersdexhttp://www.developersdex.com***
select max(datepart(yy, myColumn)) maxYear,
min(datepart(yy, myColumn)) minYear
from myTable
Navigation:
[Reply to this message]
|