Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Last Entry Date for Each Quarter

$
0
0

Hi,

I want to find out the last entry date for each quarter. The query I am using is this:

SELECT 
Country.Name as Country,
CONVERT(DATE,MAX([CreationDate])) as LastDateOfClipEntry,
DATEPART(Year,([CreationDate])) as Year,
DATEPART(Quarter,([CreationDate])) as Quarter
FROM 
[dbo].[Clip]
JOIN Office on Office.Code = Clip.Office
JOIN Country on Country.Code = Office.Country
WHERE YEAR(CreationDate) IN (@YEAR)
GROUP BY Country.Name,DATEPART(Year,([CreationDate])) ,DATEPART(Quarter,([CreationDate]))
ORDER BY Country.Name


Now based on the column group I added in my report the result is coming correct but not properly formatted as I want.

Below is the snapshot how its coming now:

 

I don't want the extra blanks coming for each occurrence. There should be only one line for Australia and in the single line it should show the last entry date for that quarter. How can I achieve that ? Below is the snapshot showing current config:

Thanks a lot in advance. Any help would be appreciated.


Vivek Kamath



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>