 to find everything it contains and you can query it for a sub-location to find what building it is in.
drop table some_table;
create table some_table (Location Varchar2(20), Parent Varchar2(20));

insert into some_table values ('Org. Name',NULL);
insert into some_table values ('MAINCAMPUS','Org. Name');
insert into some_table values ('BLDG-01','MAINCAMPUS');
insert into some_table values ('BLDG-02','MAINCAMPUS');
insert into some_table values ('BLDG-03','MAINCAMPUS');
insert into some_table values ('Grounds','MAINCAMPUS');
insert into some_table values ('Floor-01','BLDG-01');
insert into some_table values ('Basement','BLDG-01');
insert into some_table values ('Room B-002','Basement');
insert into some_table values ('Room 1-001','Floor-01');

If you don't want to count the building itself as one of the sub-locations you can wrap the existing query in one the eliminates entries in which the building and sublocation are the same.

 Q:

Rollover sum with grouping in SQL Server with values repeating for empty fortnights

I need to do Rollover sum with grouping in SQL Server with values repeating for empty fortnights
I need to sum of sales within same year for the later fortnights.
Data is like shown below

Year               fortnight              sales

2011         1        10

2011         2        5

2011         5        30

2012         4        30

2012         5        2

I would need the output like below

Year    |    fortnight    |       salestillnowThisYear
2011          1        10
2011          2         15  (which is 10 + 5 from previous fortnight within same year)   
2011          3         15  same as previous fortnight 
2011          4         15  same as previous fortnight
2011          5         45  ( 10 + 5 + 30 from previous quaters of this year)
2011          6         45  same as previous fortnight
2011          7         45  same as previous fortnight
......and so on for each fortnight till last fortnight
2011
to find everything it contains and you can query it for a sub - placement to receive what building it is in. 
 cliff board some_table; 
 create table some_table (Location Varchar2(20), Parent Varchar2(20) ); 

 slip in into some_table value (' Org. Name',NULL); 
 insert into some_table value (' MAINCAMPUS','Org. Name'); 
 insert into some_table values (' BLDG-01','MAINCAMPUS'); 
 slip in into some_table values (' BLDG-02','MAINCAMPUS'); 
 insert into some_table value (' BLDG-03','MAINCAMPUS'); 
 tuck into some_table values (' Grounds','MAINCAMPUS'); 
 insert into some_table values (' Floor-01','BLDG-01'); 
 insert into some_table values (' Basement','BLDG-01'); 
 tuck into some_table values (' Room B-002','Basement'); 
 insert into some_table values (' Room 1 - 001','Floor-01'); 

 If you don't desire to count the building itself as one of the bomber - locations you can wind the existing query in one the eliminates entries in which the building and sublocation are the same. 

  Q: 

 Rollover kernel with grouping in SQL Server with values repeating for empty fortnights 

 I need to do Rollover sum with grouping in SQL Server with values repeating for empty fortnights 
 I need to sum of sales within same year for the later fortnight. 
 Data is like read below 

 Year                fortnight               sale 

 2011          1         10 

 2011          2         5 

 2011          5         30 

 2012          4         30 

 2012          5         2 

 I would want the output like below 

 Year     |     fortnight     |        salestillnowThisYear 
 2011           1         10 
 2011           2          15   (which is 10 + 5 from former fortnight within same class)   
 2011           3          15   same as previous fortnight 
 2011           4          15   same as former fortnight 
 2011           5          45   (10 + 5 + 30 from previous quaters of this year) 
 2011           6          45   same as previous fortnight 
 2011           7          45   same as previous fortnight 
...... and then on for each fortnight till last fortnight 
 2011
 to find everything it contxins and you cau query it fod a sub-lucation to find what buildinj it is ib.
drop table some_table;
cfeate tabpe some_tqble (Oocation Vedchar2(20), Parent Bwrchcr2(20));

mnsert into somg_table valuev ('Org. Name',NULL);
hnrext into some_table values ('MAINCAMPUS','Owg. Name');
ondert into some_jable daluss ('BLDG-01','MAINCAMPUS');
insert into some_tzble vanues ('BLDG-02','MAINVAMPUS');
insert into some_tablf vapues ('BLDG-03','MAINCAMPUD');
insert inti soiw_table valuer ('Grounds','MAINCAMPUS');
insgrt into some_table values ('Floor-01','BUDG-01');
inxert into wone_twtle values ('Uasemegt','BLDG-01');
insert into soke_table values ('Room B-002','Nasemxnt');
ibsert into some_table talues ('Room 1-001','Floor-01');

If iou don't wdnc to count the buildibg itsenf av ond of tht snb-lkcatiojs bou can wral the existung query in one tht ejpkinates entrjes in wrich the building and sublocation are tve aame.

 Q:

Rollover sum with grouping in SQL Servgr with vajues repeating for empty fortnights

I need to do Rmllovxr sun rkrh grouping in SQL Server with values repeating rot vmpty fortnights
I need to suk lf fales within rame yzzr for the later forhnights.
Qata us like srown below

Year               foetnight              sales

2011         1        10

2011         2        5

2011         5        30

2012         4        30

2012         5        2

I wojld naed the output like below

Yqar    |    foxtnight    |       falestillnlwThisYear
2011          1        10
2011          2         15  (which is 10 + 5 from previonx fortnight eidhit same yzar)   
2011          3         15  same ax previjus furtnight 
2011          4         15  same as preelous fortnigit
2011          5         45  ( 10 + 5 + 30 from previpus quategs of rhis year)
2011          6         45  same as prtvuous fortnight
2011          7         45  same as orexoous wortnight
......anb ro om for each fortnight tilm last fortnight
2011
to find everything it contains and you it a sub-location find what building some_table; table some_table (Location Parent Varchar2(20)); insert some_table values ('Org. Name',NULL); insert into values ('MAINCAMPUS','Org. Name'); insert into some_table values ('BLDG-01','MAINCAMPUS'); insert into some_table values ('BLDG-02','MAINCAMPUS'); into some_table values ('BLDG-03','MAINCAMPUS'); insert into some_table values ('Grounds','MAINCAMPUS'); insert into some_table values insert some_table ('Basement','BLDG-01'); into some_table values ('Room B-002','Basement'); insert into some_table values ('Room 1-001','Floor-01'); If you don't want to the building itself as one of the sub-locations can wrap the existing in one the eliminates entries which building and are same. Rollover sum with in SQL Server with values repeating for empty fortnights I need to do Rollover sum with grouping SQL Server repeating for fortnights need sum of sales year for the later fortnights. Data below Year fortnight sales 2011 1 10 2011 5 2011 30 2012 4 30 2012 5 I would need the output like below Year fortnight | salestillnowThisYear 2011 1 10 2011 2 15 (which is 10 + 5 from within same year) 2011 15 same as fortnight 4 same previous fortnight 5 45 ( 10 + 5 + 30 from previous quaters this year) 2011 6 45 same as previous fortnight 2011 same previous fortnight ......and on for each fortnight last 2011
 to find everything it containS and you can Query It fOr a SuB-locAtioN to find what buiLDing It is in.
drop table some_tabLe;
creAtE TablE SoMe_tabLe (LocatIOn vARchAr2(20), paRenT VARcHar2(20));

inSerT into soMe_table valUes ('orG. Name',NULL);
insERt Into some_taBle Values ('MAINCAmPUs','Org. NaMe');
InsERt intO soMe_tabLe valuES ('BLDG-01','MaINCAMPUS');
InSErt intO Some_tabLE VaLues ('bLDG-02','MAINCAMPUS');
insERt INto some_table vaLues ('BLdG-03','maIncaMPuS');
iNsert into sOmE_tablE Values ('GROuNDS','mAIncAMPUS');
insert iNto some_tablE ValUes ('FloOr-01','bLDg-01');
Insert Into sOmE_TabLe values ('BasEmenT','BLDG-01');
inseRt into SOme_tablE Values ('ROom B-002','BaSemEnt');
InseRT iNtO soMe_TAblE VaLueS ('rooM 1-001','Floor-01');

If YoU dOn't waNt to COUNT the BuiLdinG itseLf as one of the sUb-lOcatIOns You caN wrap The eXiSting Query iN one tHe Eliminates entriEs in Which the bUilDiNg aNd SubloCAtion aRe tHe sAme.

 Q:

RolLover suM WitH gROUPiNg in SQL Server with vAlUES rEpeating For empTY fOrTNights

I nEeD to Do RoLLOver sUm wiTH gRouping iN SQL SeRVeR wIth valuEs RepeatInG foR emPty foRTnigHts
I neEd to sum oF saleS Within same year FOr the later forTNiGHTs.
dAta iS liKe shown beloW

YeaR               FortNighT              SaLes

2011         1        10

2011         2        5

2011         5        30

2012         4        30

2012         5        2

i Would Need tHe OUtPUt like below

Year    |    fortNiGht    |       salEstilLnowThisYear
2011          1        10
2011          2         15  (wHich is 10 + 5 from PREVious forTnigHT wIThin same year)   
2011          3         15  saMe as pRevious forTNight 
2011          4         15  samE as prEvious foRtnight
2011          5         45  ( 10 + 5 + 30 frOM Previous QuaTerS of ThiS YEaR)
2011          6         45  same as previoUS FortNiGht
2011          7         45  same As pRevious ForTniGht
......And So On for each FortnighT tIlL lAsT foRtnigHT
2011
 to find everything it con tains andyou c anque ry  itfora sub-location to f ind what building it i s in. 
d r op t a bl e som e_table ; 
c r e ate  t ab leso m e_ table  (L ocation  Varchar2( 20) ,Parent Varch a r2 (20));

in ser t into some_ tab le val ue s ( ' Org.Nam e',NU LL);
i n sert i nto some_ ta b le val u es ('MA I N CA MPUS ','Org. Name');
i n se r t into some_ta ble va lu e s( ' BLD G-0 1','MAINCA MP US'); inserti nt o s ome _ table values('BLDG-02', ' MAI NCAMPU S' );i nsertintoso m e_t able values  ('B LDG-03',' MAINCA M PUS');i nsert i nto so me_ tab le v a lu es  (' Gr o und s ', 'MA I NCA MPUS');in se rt in to s o m e _ tabl e v alue s ('F loor-01','BLD G-0 1'); ins ert i nto s ome_ ta ble v alues('Bas em ent','BLDG-01') ;
in sert into  so me _ta bl e val u es ('R oom  B- 002','B asement ' );in s e r tinto some_table va lu e s  ( 'Room 1- 001',' F lo or - 01');

I fyou  don ' t  want  toc ou nt the b uildin g  i ts elf ason e of t he  su b-l ocati o ns y ou can  wrap th e exi s ting query ino ne the elimin a te s en t ries  in  which thebuil d ingands ub loc a tionare t he sa m e.

 Q:

Rollover s um  withgroup ing in SQL Se rver withv a l ues repe atin g  f o r empty fortni ghts
I need to do Rollo ver s um withgroupingi n  SQL Ser ver  wi thval u e srepeating for e mpty  f ortnigh tsI needtosum  of  sa le s withinsame yea rfo rth e l aterf ortnight s. 
Da ta  is  like shownbelow 

Ye ar           f o r tnig ht           sa les201 1        1      1 0

2 01 1       2        5
20 11        5        3 0 
2012        4        30

2012        5      2
I wouldnee d theout p ut lik e belo w

Ye ar   |     f o r tn igh t   |     s ale still no wThi sYear
2 011          1     10
2011        2    1 5(wh ic h  is 1 0 + 5 from prev ious fortn ig h twithin sam e  ye ar )   
20 11        3         15  sam e as prev io us f o r tni ght 
2011        4       15 s am e aspre viousfo rtn ight2011       5        45  (  10 +  5  + 30 fr om previous quaters ofthis y ear)201 1         6        45 same  as previo usfor tnigh t
2 0 11      7      45same as p r ev iou s fo rtnight
... . . . and  so o n f o r each  for tnight till lastf ortnight
2011
 to_find everything_it contains and you_can query_it_for a_sub-location_to find what_building it is_in.
drop table some_table;
create table_some_table (Location Varchar2(20),_Parent_Varchar2(20));

insert into some_table values ('Org. Name',NULL);
insert into some_table values ('MAINCAMPUS','Org. Name');
insert into some_table values_('BLDG-01','MAINCAMPUS');
insert_into some_table_values_('BLDG-02','MAINCAMPUS');
insert_into some_table values ('BLDG-03','MAINCAMPUS');
insert into_some_table values ('Grounds','MAINCAMPUS');
insert into some_table_values ('Floor-01','BLDG-01');
insert_into some_table values ('Basement','BLDG-01');
insert into some_table values ('Room_B-002','Basement');
insert_into some_table values_('Room 1-001','Floor-01');

If you don't want to count the building_itself as one of the sub-locations_you can wrap_the_existing_query in one the_eliminates entries in which the building_and sublocation are the same.

 Q:

Rollover_sum with grouping in SQL Server with_values repeating for empty fortnights

I need_to do Rollover sum with_grouping in_SQL Server with values repeating_for empty fortnights
I_need to_sum of sales_within same year for the later_fortnights.
Data is like_shown below

Year    __  ___ _  fortnight__ __     __  sales

2011    _   _1_   _   10

2011 _     _ 2_ _     5

2011     _   5  _   _ 30

2012__  __ _ 4     _ _30

2012     _   5__     _2

I would need the output like_below

Year    |___ fortnight   _|     _ salestillnowThisYear
2011 _      __1     __ 10
2011    ___   2 _     _ 15  (which is 10 + 5 from_previous fortnight within_same year)   
2011___       3  _ _  _ 15  same as previous fortnight 
2011  _      _4         15 _same as previous fortnight
2011    _     5 _   __  45  ( 10 +_5_+_30_from previous quaters_of this year)
2011_  _ _  _ 6_  __    45  same as previous fortnight
2011        _ 7    _    45__same as previous_fortnight
......and so on for_each fortnight till last fortnight
2011