tsql - SQL Server how to get Count of a field for the current Quarter from Date? -


i have hard time assembling sql statement. scenario/requirement this: need count of field in current quarter.

select count(fieldname) hits  tablename  dateposted = (current quarter) 

i no of hits/count current quarter.

is possible?

select count(fieldname) hits  tablename datepart(q,dateposted) = datepart(q,getdate()) , year(dateposted) = year(getdate()) 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -