Avatar of Phil Chapman
Phil ChapmanFlag for United States of America

asked on 

Grouping Records By Year Query

The query below gives me the total accounts with the same submission date.  But  I need the total accounts with the same year only.

What needs to be changed in the query?


SubmissionDate is a DateTime datatype

SELECT count(account)as NumOfAccounts,SubmissionDate
FROM Accounts
Group By SubmissionDate HAVING count(account)> 0
Microsoft SQL Server

Avatar of undefined
Last Comment
Phil Chapman
ASKER CERTIFIED SOLUTION
Avatar of Rajeev
Rajeev
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Phil Chapman
Phil Chapman
Flag of United States of America image

ASKER

Perfect!

Thanks
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo