troubleshooting Question

Group By DatePart

Avatar of feesu
feesu asked on
Microsoft SQL Server
4 Comments1 Solution657 ViewsLast Modified:
I've got the following SP, my intention is to pull out all the unique minutes (distinct) and i don't want duplicates, but i'm getting them!

DECLARE @Language_IKey INT
SET @Language_IKey =2
SELECT CASE WHEN @Language_IKey=2 THEN Sector_A ELSE Sector_E END AS Sector,Max(ValueDate) ValueDate,Max(Last) Last,Max(LastW) LastW
FROM Feed_KSE_KARS_Indices
WHERE SectorID=0
GROUP BY ValueDate,Sector_A,Sector_E,DATEPART(MINUTE,ValueDate)
ORDER BY ValueDate
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros