Separate Header, Main, Trailer for each group of date

Hi,
I have report built-in Oracle Reports10g R2, with Header, Main, Trailer sections, I am running report for different date parameters, for instance date between 29-30 Dec, 11.
But when i get output of the report it do format as I expect, mean output comes in this way Header(29, 30 Dec), Main(29, 30 Dec), Trailer(29, 30). I made separate repeating frame for all of 3 sections which is based on DATE parameter. I want output to be Header(29 Dec), Main(29 Dec), Trailer(29) and same for 30th Dec.
Somebody will guide me please what is wrong with my report.
Thanks and Regards,
Syed Khawar
Edited by: S.Khawar on Jan 4, 2012 11:44 AM

Hi bombocha,
According to your description, you want to export each group to separate Excel File. As tested in my environment, we can use filter and subscription to achieve your goal. Please refer to the following steps:
Supposing we have a table grouping on SalesTerritoryGroup field, we can create another dataset Dataset2 using the simple queries "Select distinct SalesTerritoryGroup from ...".
Add a parameter @SalesTerritoryGroup to the report, then get Available Values from Dataset2 SalesTerritoryGroup field.
Create a filter on the dataset used to extract report data, set Expression: SalesTerritoryGroup, Operator: =, Value: [@SalesTerritoryGroup].
Deploy the report to report manager and create a data-driven subscription with Windows File Share delivery extension.
In step 3 of creating the subscription, specify the query as "Select distinct  SalesTerritoryGroup  from ..." and click on Validate button.
In step 4, set file name as Get the value from the database: SalesTerritoryGroup, and set Render Format to Excel.
In step 5, as to the SalesTerritoryGroup parameter values, select SalesTerritoryGroup from Get the value from the database drop down list.
Create a schedule for the subscription, then click Finish.
For more information about Data-driven Subscriptions, please refer to the following article:
Data-driven Subscriptions in SSRS
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu

Similar Messages

  • Adding ssrs chart for each group under group footer

    Hi,
    I have requirement of report design, user has ability to select single or multiple product name in parameter and it should display column headers for each group and chart for each group (product name). 
    Report Design
    ProductName: A
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    ProductName: B
    Category JAN
    FEB MAR
    Sales 10
    12 15
    Budget 20
    20 20
    Chart Here
    I want to repeat this for all products.
    Please anyone can provide steps to how to achieve this design?

    Hi Srikanth,
    According to your description, you want to design a tablix to display header and chart for each group in its group header and footer. Right?
    In Reporting Service, when we add header and footer for a group, the header row and footer row are still within this group. Anything we put in these two rows will be grouped. For your requirement, we created a sample report in our local environment. Here
    are steps and screenshots for your reference:
    1. Create a matrix. Columns are grouped by month. Rows are grouped by ProductName (with group header and footer).
    2. Put the text/field of the first row into the group (ProductName) header. Delete the header row of matrix (the first row), select Delete rows only.
    3. Insert a chart into the group footer. It looks like below:
    4. Add a parameter for filtering data. Save and preview it looks like below:
    Reference:
    Understanding Groups (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Adding a chart for each group in ssrs not below are above the group in group footer or header. but side of the table data

    Hi
    I am currently adding a chart for each group on group footer in a table.
    but i want that charts to be on the right side of the group data.
    regards
    Pratap M:)

    Hi PratapM,
    If I understand correctly, you have already added a chart in group footer, and you want to display the chart on the right side of the cell. If I have misunderstood, please don't hesitate to let me know.
    Based on my research, if we directly add a chart into a cell, the chart will fill all of the space in the cell. So in order to achieve your requirement, we can insert this chart into a rectangle, then add the rectangle to the group footer. If we want to
    display the chart on the right side, we can directly drag the chat to the right of the rectangle.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • ?for-each-group? dosen't work with page break - rtf template???

    Hello all,
    When I give a page break inside the for-each-group the group doesn't iterate any code after the page break. I can't give <?split-by-pagebreak?> in this case because I want that loop to be iterated for every department, and should show the report in one column(ms word column), and the department description in two columns.....as this has to happen for every department I can't write separate code........everything should go into one file......
    Final file should look like:
    <for every department>
    <department_report-a table>--one column(ms word column)
    <department_description-a huge text>--two columns(ms word columns)
    <next department>
    how can I achieve this - please help, its urgent.
    Thanks for your time.
    DK

    bipuser thanks for your response
    i will have table data also so i cannot keep in the same line.
    its strange for the last 2-3 days below syntax gave me space at the beginning of each group now it is working i didnt do any change
    <?for-each:G_1?>
    ABCDEFDG
    <?split-by-page-break:?><?end for-each?>

  • Variables + for each group + xml publisher

    Hi All,
    My requirement: one group is repeating many times, but based on one data in that group i need to display it.
    Ex:
    <GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>10-Aug-2008</DATE>
    <DESC>Testing2</DESC>
    </GROUP><GROUP>
    <DATE>23-July-2007</DATE>
    <DESC>Testing1</DESC>
    </GROUP>
    In the above exapmle if u see the date xml tag holds 2 different dates which is same (repeating twice). But while displaying i need to show that only once.
    Means.. 23-July-2007 - 1 time and 10-Aug-2008 - 1 time instead of twice.
    I tried through using variables. getting the first date in that variable and checking with others. But not able to compare those..... (No idea)
    How can we achieve that. Please someone help me in this ASAP.
    Thanks in Advance,
    Vinoth

    Shanmu, thanks for responding -- I think I may have actually figured this out. I believe I had a trailing "/" on my "select" on the for-each-group that wasn't supposed to be there. I've reviewed this stuff so many times my eyes are crossed -- but this time I saw it. I've done some additional testing and it appears to be working properly, although I'm going to be extending the functionality now to include a nested for-each-group so we'll see how that goes.
    I'm marking this one as answered for now as it does appear to be working as expected.
    Thanks!!

  • Using If condition in For EACH Group

    Hi all,
    I want to use if condition in for-each-group. Basically my requirement is that i want to use dynamic grouping. There will be two groups and the upper group and lower group will be selected on the basis of a report parameter.
    I hope i made it clear enough. So please help me in this. Any ideas will be highly appreciable.
    Thanks and regards
    Naveed

    You can add a If condition filed after the for-each field
    for EG : <?if:ADDRESS_TYPE = 'Employee Address'?>
    and then add anothet field which has <?end if?>
    Hope this helps.
    Thanks,

  • How to generate Header and Trailer for a file

    Hi Guru
    How can we generate header and Trailer for a file
    EX:
    i want to generate header with date and trailer with record count from table.
    Sample file :
    20120120
    fwsfs
    adfwsfd
    adff
    afsadf
    afdwsg
    adgsg
    adgsgg
    asgdsag
    sdgasgdaf
    sdfsagfadf
    10

    Hi ,
    1.Create an interface to load data from oracle to file and set generate header as false option in IKM .
    2.Create variable get_current_date of alphanumeric datatype and implement logic SELECT to_Char(SYSDATE,'yyyymmdd') FROM DUAL under refreshing tab
    3.Create variable get_record_count of numeric datatype and implement logic SELECT '<%=odiRef.getPrevStepLog("INSERT_COUNT")%>' FROM DUAL under refreshing tab
    4.Create a package
    Drag the get_current_date variable ,
    Drag odioutfile and paste the below logic OdiOutFile "-FILE=D:\ODI_TEST\emp.txt" "-CHARSET_ENCODING=ISO8859_1" "-XROW_SEP=0D0A" #GET_current_date in command tab
    Drag the interface
    Drag another variable get_Record_count
    Drag the odioutfile and paste the below logic OdiOutFile "-FILE=D:\ODI_TEST\emp.txt" -APPEND "-CHARSET_ENCODING=ISO8859_1" "-XROW_SEP=0D0A"
    #GET_RECORD_COUNT in command tab
    Link all these in sequence,save and run the package.
    OR Modify the IKM SQL to File Append to achieve same functionality.
    Thanks,
    Anuradha

  • Getting the first row for each group

    Hi Everyone,
    I have a query which returns a number of rows, all of which are valid. What I need to do is to get the first row for each group and work with those records.
    For example ...
    client flight startairport destairport stops
    A fl123 LGW BKK 2
    A fl124 LHR BKK 5
    B fl432 LGW XYZ 7
    B fl432 MAN ABC 8
    .... etc.
    I would need to return one row for Client A and one row for Client B (etc.) but find that I can't use the MIN function because it would return the MIN value for each column (i.e. mix up the rows). I also can use the rownum=1 because this would only return one row rather than one row per group (i.e. per client).
    I have been investigating and most postings seem to say that it needs a second query to look up the first row for each grouping. This is a solution which would not really be practical because my query is already quite complex and incorporating duplicate subqueries would just make the whole thing much to cumbersome.
    So what I really new is a "MIN by group" or a "TOP by group" or a "ROWNUM=1 by group" function.
    Can anyone help me with this? I'm sure that there must be a command to handle this.
    Regards and any thanks,
    Alan Searle
    Cologne, Germany

    Something like this:
    select *
    from (
       select table1.*
       row_number() over (partition by col1, col2 order by col3, col4) rn
       from table1
    where rn = 1In the "partition by" clause you place what you normally would "group by".
    In the "order by" clause you define which will have row_number = 1.
    Edit:
    PS. The [url http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/functions004.htm#i81407]docs have more examples on using analytical functions ;-)
    Edited by: Kim Berg Hansen on Sep 16, 2011 10:46 AM

  • Top N for each grouping?

    Is there a way to show in OBIEE the Top N results for each group?
    I want to show the top 10 amounts for each region in my table. If using a Top N filter, it returns the Top N overall results. I tried creating a pivot table and using 'Region' as the section separator, but got the same results. It's only returning 10 amounts total, and I want to see 10 amounts for each region.
    Kevin

    Yep,
    Use the by statement:
    TOPN("F1 Revenue"."1-01 Revenue (Sum All)", 10 by "D2 Market"."M01 Market")
    regards
    John
    http://obiee101.blogspot.com/

  • Can i set up separate bookmarks in safari for each iMac  user

    can i set up separate bookmarks in safari for each iMac user???

    Searched the support community to unearth this (bit aged, but unanswered)question. Me too face the same problem. SAFARI BOOKMARKS show up the same under all user accounts. Searched all possible setting options but no obvious setting options found (at least by me) to keep them seperate for different users. Can anyone help?

  • How to compare the value node of a for-each-group with other for-each-group

    Hello!
    I have a report in Oracle BI Publisher (10.1.3.2) with several data set. My XML schema is something like
    <DATA>
    <PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>111111</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>12345</A_ID>
    <DESCRIPTION>DEF</DESCRIPTION>
    <VALUE>222222</VALUE>
    </MY_PARAMETERS>
    <MY_PARAMETERS>
    <A_ID>67890</A_ID>
    <DESCRIPTION>ABC</DESCRIPTION>
    <VALUE>333333</VALUE>
    </MY_PARAMETERS>
    </PARAMETERS>
    <NAMES>
    <MY_NAMES>
    <A_ID>12345</A_ID>
    <NAME>ASDF</NAME>
    </MY_NAMES>
    <MY_NAMES>
    <A_ID>67890</A_ID>
    <NAME>EFGH</NAME>
    </MY_NAMES>
    </NAMES>
    <VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>10987</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>12345<A_ID>
    <VALUE>26385</VALUE>
    <DESCRIPTION>EFGHI</DESCRIPTION>
    </MY_VALUES>
    <MY_VALUES>
    <A_ID>67890<A_ID>
    <VALUE>24355</VALUE>
    <DESCRIPTION>ASDFG</DESCRIPTION>
    </MY_VALUES>
    </VALUES>
    </DATA>
    I'm trying to build a rtf template in Word using this XML schema. The "A_ID" nodes in each group in my data have the same value. I want for each "A_ID" take the respective values in /DATA/VALUES/MY_VALUES.
    <?for-each-group:MY_PARAMETERS;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ABC'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='DEF'?>
    <?VALUE?>
    <?end when?><?end choose?>
    <?end for-each?>
    <?/DATA/NAMES/MY_NAMES/VALUE?>
    <?for-each-group:/DATA/VALUES/MY_VALUES;./A_ID?>
    <?for-each:current-group()?>
    <?choose:?><?when: DESCRIPTION='ASDFG'?>
    <?VALUE?> <---------------- I obtain for this node the '24355' and '10987' values
    <?end when?><?end choose?>
    I want to know how to obtain only '24355' value, this is, the value for A_ID (/DATA/VALUES/MY_VALUES) = A_ID (/DATA/PARAMETERS/MY_PARAMETERS).
    Can someone help me?

    CREATE OR REPLACE TRIGGER "TEST_TRG"
       BEFORE UPDATE OF "STATUS"
       ON "TABLE1"
       FOR EACH ROW
    BEGIN
       IF (:NEW.status = 'HOLD')
       THEN
          INSERT INTO table2
                      (status
               VALUES (:NEW.status
       END IF;
    END;You should learn how to write PL/SQL code.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Last() not returning correct value within for-each-group

    I've found inconsistent results between JDeveloper and SOA Suite using the xslt 2.0 for-each-group construct.
    &lt;xsl:for-each-group select="Po/PoLine" group-by="itemId"&gt;
    &lt;xsl:if test="position()=1"&gt;
    &lt;GroupCount&gt;
    &lt;xsl:value-of select="last()"/&gt;
    &lt;/GroupCount&gt;
    &lt;/xsl:if&gt;
    &lt;/xsl:for-each-group&gt;
    What I expect is the function last() to give me the number of groups which is the unique number of itemIds.
    In JDeveloper 10.1.3.4, testing this construct gives me what I expect.
    At run-time (deployed to 10.1.3.3 SOA Suite), the value returned is the total number of records, not the number of groups.
    For example, given the following XML
    &lt;Po&gt;
    &lt;PoLine&gt;
    &lt;itemId&gt;<strong>001</strong>&lt;/itemId&gt;
    &lt;description&gt;Hammer&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;PoLine&gt;
    &lt;itemId&gt;<strong>001</strong>&lt;/itemId&gt;
    &lt;description&gt;Hammer&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;PoLine&gt;
    &lt;itemId&gt;<strong>002</strong>&lt;/itemId&gt;
    &lt;description&gt;Nail&lt;/description&gt;
    &lt;quantity&gt;10&lt;/quantity&gt;
    &lt;/PoLine&gt;
    &lt;/Po&gt;
    Grouping by <strong>itemId</strong>, last() should return 2 as there are two groups (001 and 002). JDeveloper does this.
    When deployed to SOA Suite, last() returns 3.
    Any ideas?

    Hi,
    if JDeveloper is doing the right thing then this issue should be reported to the SOA Suite forum or BPEL BPEL , what do you think ?
    Frank

  • Asset transfer report - for-each-group

    - <FAS430>
    - <LIST_G_SETUP>
    - <G_SETUP>
    <COMPANY_NAME>ABCD</COMPANY_NAME>
    <LOCATION_FLEX_STRUCTURE>101</LOCATION_FLEX_STRUCTURE>
    - <LIST_G_ASSET_TRANS>
    - <G_ASSET_TRANS>
    <ASSET_NUMBER>1321780</ASSET_NUMBER>
    <ASSET_DESCRIPTION>CABLES & CONNECTORS</ASSET_DESCRIPTION>
    <TAG_NUMBER>K-PM-B-HCB-3899</TAG_NUMBER>
    <TRANSNUM>3512926</TRANSNUM>
    - <LIST_G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>0</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE NONE CHALODE NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>-200</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>-89983.26</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>-18.96</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE.NONE.CHALODE.NONE</D_LOCATION>
    <D_AS_COST><89,983.26></D_AS_COST>
    <D_AS_DEPRN_RSV><18.96></D_AS_DEPRN_RSV>
    <AS_COST>-89983.26</AS_COST>
    <AS_RESERVE>-18.96</AS_RESERVE>
    </G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>1</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE NONE CHALODE NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>199</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>18.87</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>89533.34</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE.NONE.CHALODE.NONE</D_LOCATION>
    <D_AS_COST>89,533.34</D_AS_COST>
    <D_AS_DEPRN_RSV>18.87</D_AS_DEPRN_RSV>
    <AS_COST>89533.34</AS_COST>
    <AS_RESERVE>18.87</AS_RESERVE>
    </G_TRANSFERS>
    - <G_TRANSFERS>
    <TO_FROM>1</TO_FROM>
    <GL_ACCOUNT>81216</GL_ACCOUNT>
    <COMP_CODE>118</COMP_CODE>
    <COST_CENTER>000</COST_CENTER>
    <LOCATION>KANNUR CHALODE MW BB NONE CHALODE MW BB NONE</LOCATION>
    <START_DATE>21-JUL-08</START_DATE>
    <UNITS>1</UNITS>
    <ASSIGNED_TO />
    <CCID>6705</CCID>
    - <LIST_G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>.09</DEPRN_RESERVE>
    <COST>0</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    - <G_SUB>
    <DEPRN_RESERVE>0</DEPRN_RESERVE>
    <COST>449.92</COST>
    <YTD_DEP>702</YTD_DEP>
    </G_SUB>
    </LIST_G_SUB>
    <D_GL_ACCOUNT>81216</D_GL_ACCOUNT>
    <D_COMP_CODE>118</D_COMP_CODE>
    <D_COST_CENTER>000</D_COST_CENTER>
    <D_LOCATION>KANNUR.CHALODE MW BB.NONE.CHALODE MW BB.NONE</D_LOCATION>
    <D_AS_COST>449.92</D_AS_COST>
    <D_AS_DEPRN_RSV>0.09</D_AS_DEPRN_RSV>
    <AS_COST>449.92</AS_COST>
    <AS_RESERVE>.09</AS_RESERVE>
    </G_TRANSFERS>
    </LIST_G_TRANSFERS>
    <DPIS>30-JUN-08</DPIS>
    <ASSET_CATEGORY>BT</ASSET_CATEGORY>
    </G_ASSET_TRANS>
    We are trying to use XML Publisher to create an Asset transfer report. The element TO_FROM=0 denotes the From part of the asset transfer, the TO_FROM=1 denotes the To part of the asset transfer.. in this case we have a asset 200 units transfered 199 and 1 to two locations..in out rtf we are getting only the first line i.e.199..we have begin the group by <?for-each-group@section:G_ASSET_TRANS;ASSET_NUMBER?><?variable@incontext:G2;current-group()?>. In the units column we are giving <?$G2/LIST_G_TRANSFERS/G_TRANSFERS[./TO_FROM=1]/UNITS?>
    Edited by: user648077 on Nov 3, 2008 10:26 PM

    Hi Srini,
    Thanks for the help..we got it resolved at out end.. we added another group <?for-each-group:$G2/LIST_G_TRANSFERS/G_TRANSFERS[./TO_FROM=1];LIST_G_SUB?><?variable@incontext:G3;current-group()?> and then used it in the units column...<?$G3/UNITS?>
    Thanks
    Ramanathan

  • Count() for each group, but only groups having 1+ element like... AND all elements like...

    There are tables(and columns) like:
    'Clients'(clientID)
    'Houses' (houseID)
    'Visits' (clientID, houseID, visit_date)
    'Contracts'(contractID, houseID, clientID, rentDate_from, rentDate_end)
    I have problem with writing MS SQL query of this kind:
    how many visits to houses did each client, before renting one of them?
    Its easy to count total number of Visits for each client, listing all visits + group by clientID and selecting count(*) for each group.
    Lets say this is select_1, and select_2 is listing all Contracts for all clients.
    Select_1 is not answer, because count must be performed only on groups, which:
    -have at least 1 row "like" row in select_2 (it means that at least one of visited houses was rented, because it can happen that client visited few houses, but rented other, not visited house). my idea for this is comparing select_1 and select_2 with:
    "where s1.clientID=s2.clientID and s1.houseID=s2.houseID"
    -each group must have all rows(visits) with date of same day or earlier than contract date
     maybe: "datediff(day, s1.visit_date, s2.rentDate_from) >= 0"

    In future, please provide proper DML, DDL and example data, like I have for you below.
    DECLARE @clients TABLE (clientID INT, name VARCHAR(20))
    INSERT INTO @clients (clientID, name)
    VALUES (1, 'Jonathan'),(2, 'Christopher'),(3, 'James'),(4, 'Jean-Luc'),(5, 'William')
    DECLARE @houses TABLE (houseID INT, address VARCHAR(20))
    INSERT INTO @houses (houseID, address)
    VALUES (1, 'NX01'),(2, 'NCC 1701'),(3, 'NCC 1071A'),(4, 'NCC 1701D'),(5, 'NCC 1701E')
    DECLARE @visits TABLE (clientID INT, houseID INT, visitDateTime DATETIME)
    INSERT INTO @visits (clientID, houseID, visitDateTime)
    VALUES (1,1,'2001-01-01 12:13:14'),
    (2,2,'2001-01-02 12:13:14'),
    (3,2,'2001-01-01 12:13:14'),(3,3,'2001-01-01 12:13:14'),
    (4,4,'2001-01-01 12:13:14'),(4,5,'2001-01-01 12:13:14'),
    (5,4,'2001-01-01 12:13:14'),(5,5,'2001-01-01 12:13:14')
    DECLARE @contracts TABLE (contractID INT IDENTITY, houseID INT, clientID INT, rentStartDate date, rentEndDate date)
    INSERT INTO @contracts (houseID, clientID, rentStartDate, rentEndDate)
    VALUES (1,1,'2001-01-02',NULL),(2,2,'2001-01-02',NULL),(3,3,'2001-01-02',NULL),(4,4,'2001-01-02',NULL),(5,5,'2001-01-02',NULL)
    SELECT contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address, COUNT(v.clientID) AS visits
    FROM @contracts c
    LEFT OUTER JOIN @clients cl
    ON c.clientID = cl.clientID
    LEFT OUTER JOIN @houses h
    ON c.houseID = h.houseID
    LEFT OUTER JOIN @visits v
    ON c.clientID = v.clientID
    AND c.rentStartDate >= v.visitDateTime
    GROUP BY contractID, c.houseID, c.clientID, rentStartDate, rentEndDate, cl.clientID, name, h.houseID, address

  • Do we need separate Unattended service account for each SharePoint Server 2013 BI service applications?

    SharePoint 2013 - I'm planning to use 'unattended service account' method of Secure Store Service - for Excel, Performance Point and Visio services. I'm about to create Active directory accounts for them.
    Question: Do we need separate Active directory accounts for each service
    DomainName\ExcelUnattendedAccount
    DomainName\PPSUnattendedAccount
    DomainName\VisioUnattendedAccount
    (or)
    Can I have just one Active Directory account DomainName\SharePointUnattendedAccount ?
    Are there any drawbacks having a single account? Any best practice around this? For all the three services the data sources are going to be the same. 
    Subash.S

    Security is the only reason you would separate accounts (as these accounts must have access to the source data). There should be no other drawbacks.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for

  • Apex 3.1.2 Development Environment typo

    <ol> <li>On the Report Attributes tab of a report...</li> <li>in the Layout and Pagination      section...</li> <li>the field label "Report Attributes Substituion"</li> </ol> I'm thinking there's a 't' missing there. Yet how many times have we all gl

  • How do you remove malware/spyware on MacBook Pro?

    Hi, I think I might have picked up malware/spyware when I had a spoofing/phishing incident while trying to purchase an item online. I ended up noticing that when I go to other websites such as Ebay, when I attempt to make a purchase, I am redirected

  • Fitting photos on screen in slide show

    I have played with the setting "Scale Photos to Fit Screen" but still have problems with photos being oddly cropped, usually on the tall/vertical oriented pics. ??

  • Top n analysis without analytical function or rownum

    Hi I am working on Oracle 9i and i have the following query. My data is like as Year Type Total 1996 A 23 1996 B 34 1996 C 19 1996 D 11 1996 E 45 1996 F 32 1997 A 12 1997 B 11 1997 C 34 1997 D 45 1997 E 67 1997 F 11 My requirement is to get the top 4

  • Dynamic Page parameters

    Please help. I have 2 dynamic pages and I want to pass parameters between them in the 1st dynamic page I have: <FORM METHOD=POST ACTION="url/owner.dyn_crt_login.show"> <INPUT TYPE=TEXT NAME=P_Login_In ID=P_Login_In>Login <INPUT TYPE=TEXT NAME=P_Pswd_