This is my query.
select CONVERT(varchar, cast(date as datetime), 3)
from shoptransfer
group by year (date)
I want to group by the year pa
How about:
select datepart(yyyy, [date]) as [year]
from shoptransfer
group by datepart(yyyy, [date])
Or:
select count(*) as qty, datepart(yyyy, [date]) as [year]
from shoptransfer
group by datepart(yyyy, [date])
order by [year]
This is based on OP's command: "I want to group by year part of date (varchar) column"