none
Weekly report creating issue during end of year.(Combined two week in one week when last week is split in two.)

    Question

  • Hi all,

    I have one weekly report that show week wise data in column group.

    but now I'm getting the issue; like when the year will be end then it shows last week data in two groups .

    For Example;

    select Datepart(WK,(GETDATE()-14)),GETDATE()-14
    union all
    select Datepart(WK,(GETDATE()-13)),GETDATE()-13
    union all
    select Datepart(WK,(GETDATE()-12)),GETDATE()-12
    Union all
    select Datepart(WK,(GETDATE()-11)),GETDATE()-11
    union all
    select Datepart(WK,(GETDATE()-10)),GETDATE()-10
    WK	date
    53	2013-12-31 12:46:34.200
    53	2013-12-30 12:46:34.200
    1	2014-01-01 12:46:34.200
    1	2014-01-02 12:46:34.200
    1	2014-01-03 12:46:34.200

    current output :

    1		53	
    date		date	
    		12-30-2013 1:09:36 PM	
    		12-31-2013 1:09:36 PM	
    1-1-2014 1:09:36 PM			
    1-2-2014 1:09:36 PM			
    1-3-2014 1:09:36 PM			

    but i need   either below

    1
    date
    12-30-2013 1:09:36 PM
    12-31-2013 1:09:36 PM
    1-1-2014 1:09:36 PM
    1-2-2014 1:09:36 PM
    1-3-2014 1:09:36 PM

    or

    53	
    date	
    12-30-2013 1:09:36 PM	
    12-31-2013 1:09:36 PM	
    1-1-2014 1:09:36 PM	
    1-2-2014 1:09:36 PM	
    1-3-2014 1:09:36 PM	
    	
    


    i.e Combined two week in one week when last week is split in two.

    Kindly help.

    Thanks .



    • Edited by BI_group Monday, January 13, 2014 7:46 AM
    Monday, January 13, 2014 7:21 AM

Answers

All replies