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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

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

ios - I get the error Property '...' not found on object of type '...' -