Confused by right indent results in tables

Hi. Please Help. I have set an entire book of tables in indd cs3, but find my results from the tab panel erratic to non-existent.
For the examples below, text is set to left align:
1 - When the decimal tab is selected and the ruler is clicked everything aligns to it whether there is a decimal or not. (this is fine).
2 - When I select the right tab and click on the rule a line can be seen in the table at the correct position but the text does not move to align with it. (I have tried this with text aligned right, eventhough I have read Dave Blatner on the subject.)
3 - When I select the left tab and click on a rule text generally moves to the correct position but not always.
I have the following clunky workarounds, but would prefer to know why I am not able to use the left and right tabs consistently.
A - Workaround 1: set the right text to right align and then use the tab on the right to bring text into the correct position.
B - Workaround 2: use the left indent tab to set the left aligned text in the column.
In the workflow I have set up paragraph styles, used these in cell styles, and then used the cell styles in table styles.
The relevant text is in columns set below merged and centred information in the header.
I have restarted and cleared out prefs as well as exporting to an inx file but I am still not winning.
Please help as I think these tables will be repurposed for different uses and it would be pleasant to overcome the issues.
Tx
Gordon Eddey

From your screen shot I see you are using CS3, but that doesn't appear to be the cause, as the behavior is still present up to CS5.
I'm far from an expert on tables -- I hate and avoid working with them as much as possible -- but it appears to me that the decimal tab is "implied" in the cell if you set one, that is tabbing into any cell in which a decimal-aligned tab is present will move the text to the tab position. This is extremely useful for tables with columns of numbers in cells as it speeds up entry by relieving you from having to insert the tab in each cell with a number. On the other hand, the other sorts of tabs seem to be "explicit" or require you to insert the tab character into the text string in order to take advantage. This makes sense to me, more or less, also, since you are more likely to want generally left, center or right-aligned text in any cell and wouldn't need a tab to set that.
Is there a reason that setting the paragraph to right aligned and adding either a right indent to the paragraph style or a right inset to the cell style won't work as well as setting a tab stop in the definition? Do you want your right-aligned tab stops in different places in different cells? If this is something that can be controlled by a style definition, that's the way to do it, rather than by manually inserting a tab into the cell.

Similar Messages

  • Right-Indenting the last paragraph line in a Table Of Contents entry

    Hi,
    I'm using CS4 In Design.
    I'm trying to format the paragraph styles for my Table of Contents.
    I have the tab leaders working, everything looks good except that I have entries that have multiple lines, and I can't find a way to format the TOC paragraphs so that the lines BEFORE the last line are right-indented more than the last line (which of course contains the tab leads and page number).
    I'd like to not have to go into my text and manually add Right Index Tabs in every heading instance that will be pulled into the TOC.
    Thanks,
    Robert

    > How DOES one set last lines that don't leave room for leaders?
    One manually breaks the line short (or lives with no leaders) using a
    shift-return. I usually finesse TOCs after I think the client is mostly
    done with correcting.
    > I now note that some of my neat page numbers are nudged to the right...
    I'm not sure what that means. If you're using a right-aligned tab (or
    two tabs, if you want to right-align the ends of the leaders) your
    numbers should right-align on the tab setting. Exactly. Nothing should
    be "nudged to the right".
    Kenneth Benson
    Pegasus Type, Inc.
    www.pegtype.com

  • Right order of joining tables

    Hi everybody,
    I have read the SQL Tuning section of Performance Tuning Oracle Book of Oracle 10g. v.2.
    In 11.5.4. paragraph titled "Controlling the Access Path and Join Order with Hints" , in the second note there is a small paragraph about the right join of the tables....
    In whichever query i try ,i've noticed that altering the joining order of the tables the sql statistics (consistent gets , sorts(memory/disk)) are the same regardless of the join order....
    Can you please give me an example or a source in which the modification of the join order of the tables in a sql query produce different results ...in statistics????
    Thanks , a lot
    Simon

    Duplicate post. Don't answer this thread please Right order of joining tables.
    Cheers, APC

  • Problem with store ResultSet and show result in table

    Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
    1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
    When I try to println() contains of this result set in this method - it works OK (commented part),
    but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
    The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
    Is there any way to store data from ref_cursor for a long time?
    2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
    without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
    I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
    storeNewResultSet(), setUserDataForCollection()...
    I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
    Thanks for your help.
    ADF BC, JDev 11.1.1.0
    This is my code from ViewObjectImpl
    package tp.model ;
    import com.sun.jmx.mbeanserver.MetaData ;
    import java.sql.CallableStatement ;
    import java.sql.Connection ;
    import java.sql.PreparedStatement ;
    import java.sql.ResultSet ;
    import java.sql.ResultSetMetaData ;
    import java.sql.SQLException ;
    import java.sql.Statement ;
    import java.sql.Types ;
    import oracle.jbo.JboException ;
    import oracle.jbo.server.SQLBuilder ;
    import oracle.jbo.server.ViewObjectImpl ;
    import oracle.jbo.server.ViewRowImpl ;
    import oracle.jbo.server.ViewRowSetImpl ;
    import oracle.jdbc.OracleCallableStatement ;
    import oracle.jdbc.OracleConnection ;
    import oracle.jdbc.OracleTypes ;
    public class Profiles1ViewImpl extends ViewObjectImpl {
        private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
        public Profiles1ViewImpl () {
        /* 0. */
        protected void create () {
            getViewDef ().setQuery ( null ) ;
            getViewDef ().setSelectClause ( null ) ;
            setQuery ( null ) ;
        public Connection getCurrentConnection () throws SQLException {
            // Note that we never execute this statement, so no commit really happens
            Connection conn = null ;
            PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
            conn = st.getConnection () ;
            st.close () ;
            return conn ;
        /* 1. */
        protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
            storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
            // callStoredProcedure ( qc , SQL_STM ) ;
            super.executeQueryForCollection ( qc , params , numUserParams ) ;
        /* 2. */
        private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
            ResultSet rs = null ;
            rs = callStoredProcedure ( qc , SQL_STM ) ;
            return rs ;
        /* 3. */
        public ResultSet callStoredProcedure ( Object qc , String stmt ) {
            CallableStatement st = null ;
            ResultSet refCurResultSet = null ;
            try {
                st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call 
                st.setObject ( 1 , 571 ) ; //set id of my record to 571
                st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
                st.registerOutParameter ( 3 , Types.NUMERIC ) ;
                st.registerOutParameter ( 4 , Types.VARCHAR ) ;
                st.execute () ; //executeUpdate
                System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
                System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
                refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
                //   setUserDataForCollection(qc, refCurResultSet); //don't work
                //   createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
                /* this works but only one-time call - so my resultSet(cursor) really have a data
                while ( refCurResultSet.next () ) {
                    String nameProfile = refCurResultSet.getString ( 2 ) ;
                    System.out.println ( "Name profile: " + nameProfile ) ;
                return refCurResultSet ;
            } catch ( SQLException e ) {
                System.out.println ( "sql ex " + e ) ;
                throw new JboException ( e ) ;
            } finally {
                if ( st != null ) {
                    try {
                        st.close () ; // 7. Close the statement
                    } catch ( SQLException e ) {
                        System.out.println ( "sql exx2 " + e ) ;
        /* 4. Store a new result set in the query-collection-private user-data context */
        private void storeNewResultSet ( Object qc , ResultSet rs ) {
            ResultSet existingRs = getResultSet ( qc ) ;
            // If this query collection is getting reused, close out any previous rowset
            if ( existingRs != null ) {
                try {
                   existingRs.close () ;
                } catch ( SQLException s ) {
                    System.out.println ( "sql err " + s ) ;
            setUserDataForCollection ( qc , rs ) ; //should store my result set
            hasNextForCollection ( qc ) ; // Prime the pump with the first row.
        /*  5. Retrieve the result set wrapper from the query-collection user-data      */
        private ResultSet getResultSet ( Object qc ) {
            return ( ResultSet ) getUserDataForCollection ( qc ) ;
        // createRowFromResultSet - overridden for custom java data source support - also doesn't work
       protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
            ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
            return value ;
    }

    Hi I have the same problem like you ...
    My SQL Definition:
    CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
    CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
       v_title            VARCHAR2(100),
       v_store            VARCHAR2(50),
       v_sales            NUMBER(20,4),
       v_cost             NUMBER(20,4),
       v_units            NUMBER(12,4),
       v_margin           NUMBER(6,2),
       v_ly_sales         NUMBER(20,4),
       v_ly_cost          NUMBER(20,4),
       v_ly_units         NUMBER(12,4),
       v_ly_margin        NUMBER(6,2),
       v_sales_variance   NUMBER(6,2)
    CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
    AS
    v_sales_format_tab   nb_tab_storedata;
    FUNCTION sales_data_by_format_gen (
          key_value         IN       VARCHAR2,
          l_to_date         IN       DATE DEFAULT SYSDATE-1,
          l_from_date       IN       DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
          RETURN nb_tab_storedata;
    I have a PLSQL function .. that will return table ..
    when i use this in sql developer it is working fine....
    select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
                                        '05-Aug-2012',
                                        '01-Aug-2012') )
    it returning table format record.
    I am not able to call from VO object. ...
    Hope you can help me .. please tell me step by step process...
    protected Object callStoredFunction(int sqlReturnType, String stmt,
    Object[] bindVars) {
    System.out.println("--> 1");
    CallableStatement st = null;
    try {
    st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
    System.out.println("--> 2");
    st.executeUpdate();
    System.out.println("--> 3");
    return st.getObject(1);
    catch (SQLException e) {
    e.printStackTrace();
    throw new JboException(e);

  • How to align a String value to the right side inside a table column?

    Hi,
    I have a text view inside a table column which is mapped to a string attribute. I need to align the text in the text view to the right hand inside the table column. But its always getting aligned towards the left side. I have tried by setting the <b>hAlign</b> property of Element properties of Text View to <b>right / forced right</b> but still the text is getting aligned to the left side.
    How do I align the String values in Text View towards the right hand side inside a Table Column?
    Thanks and Regards,
    Sayan Ghosh

    Hello Sayan,
    if i do get it right, you are adding an TextView element to a Table Cell. Then you should consider setting aligment within the particular cell. By calling:
    YourCell.setHorizontalAlignment(CellHAlign.RIGHT)
    regards.
    mz

  • Add additional DESC column at right side of pivot table in bi publisher

    ARABIC DESC
    India
    UAE
    Total
    English DESC
    QUANT_DECIMAL
    VALUE_DHS
    QUANT_DECIMAL
    VALUE_DHS
    QUANT_DECIMAL
    VALUE_DHS
    0
    0
    0
    0
    0
    0
    اجر
    4
    4
    23
    5619
    27
    5623
    ABC
    اجر
    0
    0
    10
    3510
    10
    3510
    CDF
    ملابس
    0
    0
    14
    772
    14
    772
    XYX
    جالية
    0
    0
    25
    2020
    25
    2020
    EJB
    Total
    4
    4
    72
    11921
    76
    11925
    please help me to add another column at right side of pivot table as marked in blue.
    1st column indicates in arabic desc and my client want english desc at right side of pivot table
    country is group by as INdia and UAE.
    Please help me to display the above report in pivot table in BI Publisher;
    Thanks
    Naveen

    Naveen,
    Do you have that column in the database?
    Thanks,
    Sasi Nagireddy..

  • Unable to find Right Indent when definition contains decimal number

    Dear all,
    I recieved a very long text from Microsoft Word, all set to "Normal" style. How annoying...
    Anyway, some of the paragraphs are set with Right Indent that it's size is 15.011 mm. To my knowledge, Indesign shows up to 3 numbers afer the period even if there is more.
    The problem is that when I perfome search for this size (15.011 mm)  it could not find anything and I think it's because of the hidden decimal numbers, but i'm not sure.
    Any solution will be great
    Shlomit

    It's probably a rounding problem. I'd try to get the exact measurement directly from the Word file and enter that in the ID dialog, including the units. If that doesn't work, I know I saw a similar question here, but it was more than a year ago, so a google search would be in order.

  • Using external parameters within MS Query returning that data right into a pivot table Excel 2010

    In Excel 2010 i was able to use the external parameters within MS Query returning that data right into a pivot table.  But the parameter on the worksheet will not save in the paremeter setting of the data connection.  And if you save it and open
    it and try to refresh the pivot table Excel stops responding and you have to force the file closed.  I found out the reason to crash is that it did not keep the parameter saved.
    Can this be fixed?

    Hi,
    Just
    checking in to see if the information of Oskar was helpful. Please
    let us know if you would like further assistance.
    Jaynet Zhang
    TechNet Community Support

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • tableSelection and multipleSelection on right side of the table

    Hi, I'm having problem to align the tick box selection to the right side of the table including the "Select All | Select None" function in UIX. Anyone can help me in this case? Thanks..
    <tableSelection>
    <multipleSelection text="Select items and ..." onClick="Select('${uix.current.Id}')"/>
    </tableSelection>

    ''the blank space doesn't appear in safe mode''
    This means that the problem is an add-on, user setting, or
    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences''' in the address bar and press '''Enter.'''
    Select '''Advanced > General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Then check ALL of your settings; Browser and add-ons.
    Poke around safe web sites. Are there any problems?.
    Then restart.

  • Right Indent Tab

    In CS2, with a left-justified paragraph, how do I get an line of page numbers to right-align following a Right Indent Tab?

    You must use Area Type (Click and drag box with the Type Tool)
    "Set type here [ hit tab ] Set Type here"
    Then right align the type.

  • Right-indent tabs in GREP or nested styles

    How do you specify a right-indent tab (shift-tab) in GREP or nested styles?  Is it possible?  I could only find the regular tab character.
    Thanks, Phyllis

    In GREP it looks like
    ~y
    Mind you, I don't know if that will work for you - I just copied a right-indent-tab to the clipboard and pasted it into the GREP Find What field.

  • Strange results in table

    Hi,
    I have a customer table with many fields. Two of them are production order no
    and batch no.
    When I´m using SE11 and type in a batch no, I get about 2 entries per batch no.
    If I now use a production order number of the found items for the batch number,
    and do the selection with these numbers, I don´t get any result!
    The same is happening in the debugger... I´m using the value of the production
    order number found by using the batch number, but I´m not getting any result...
    The field type is char30, so I have tried to fill the number up with leading zeros.
    Still no result!
    What can be the problem here?
    Thank you!
    Michael

    so do you mena that there is a conversion routine alpha assigned to this custom data element of char 30 ?
    I assume you mentioned about the conversion exit for data element of standard sap field for prod order, right ?
    If no conversion routine is assigned to your custom data element,  and this custom table is updated via custom program, chances are very high that the content is not filled from the beginning of the field..
    it can be form somewhere in the middle of the field..or so..thats why u are not getting when yoy try to read for prod order.
    best way is to doselect to a table and in debugging mode,
    try to do offset like prodno0(12),   prodno10(12)...prodno+18(12)/... etc and see which positions are occupied by the conent ..

  • Confused on RIGHT OUTER JOIN

    Here is a query and desired output for a weekly sales report. The problem is that if no data exists for given businessdate, the report is empty. It should show store with zeroed totals.
    NOTES:
    1. storenbr must be string
    2. bow, eow = beginning and end of week
    3. I have no say-so on the date format
    with report_stores  as
    (  select  501   as storeid from dual union all
        select   22   as storeid from dual union all
        select   24   as storeid from dual
    , store_details as
        select   501   as storeid,   '6504'    as storenbr,  'Quincey Circle' as storename  from dual union all
        select   22   as storeid,    '2385'    as storenbr,  'Goodlet' as storename   from dual union all
        select   24   as storeid,    '4290'   as storenbr,  'Poplar' as storename   from dual
    , sales_data as
        select  501 as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  100 as sales_amt, 50 as guestcount from dual union all
        select  22  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  200 as sales_amt, 50 as guestcount from dual union all
        select  24  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')   as businessdate,  300 as sales_amt, 50 as guestcount from dual  union all
        select  501 as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')   as businessdate,  400 as sales_amt, 100 as guestcount from dual union all
        select  22  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  500 as sales_amt, 100 as guestcount from dual union all
        select  24  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  600 as sales_amt, 100 as guestcount from dual 
    select  storenbr
    ,       to_date('01/30/2011', 'MM/DD/YYYY') as EOW
    ,       sum(nvl(sales_amt, 0))              as sales_amount
    ,       sum(nvl(sales.guestcount , 0))      as guestcount
    from report_stores   stores
    inner join store_details details on details.storeid = stores.storeid
    left outer join sales_data sales    on  sales.storeid = stores.storeid 
                                      and   sales.businessdate  between  to_date('01/24/2011',  'MM/DD/YYYY') and to_date('01/30/2011', 'MM/DD/YYYY')
    group by storename,      to_date('01/30/2011', 'MM/DD/YYYY');However, when I make date dynamic by adding a dates table, I don't get output.
    with report_dates as
       select to_date('01/05/2011', 'MM/DD/YYYY') as businessdate, 'Wednesday' as day_name, 2 as week_nbr,   to_date('01/03/2011', 'MM/DD/YYYY')  as bow,   to_date('01/09/2011', 'MM/DD/YYYY')  as eow from dual union all
       select to_date('01/24/2011', 'MM/DD/YYYY') as businessdate, 'Monday'    as day_name, 5 as week_nbr,   to_date('01/24/2011', 'MM/DD/YYYY')  as bow,   to_date('01/30/2011', 'MM/DD/YYYY')  as eow from dual
    , report_stores  as
    (  select  501   as storeid from dual union all
        select   22   as storeid from dual union all
        select   24   as storeid from dual
    , store_details as
        select   501   as storeid,   '6504'    as storenbr,  'Quincey Circle' as storename  from dual union all
        select   22   as storeid,    '2385'    as storenbr,  'Goodlet' as storename   from dual union all
        select   24   as storeid,    '4290'   as storenbr,  'Poplar' as storename   from dual
    , sales_data as
        select  501 as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  100 as sales_amt, 50 as guestcount from dual union all
        select  22  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')    as businessdate,  200 as sales_amt, 50 as guestcount from dual union all
        select  24  as storeid,  to_date('12/01/2010', 'MM/DD/YYYY')   as businessdate,  300 as sales_amt, 50 as guestcount from dual  union all
        select  501 as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')   as businessdate,  400 as sales_amt, 100 as guestcount from dual union all
        select  22  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  500 as sales_amt, 100 as guestcount from dual union all
        select  24  as storeid,  to_date('12/02/2010', 'MM/DD/YYYY')    as businessdate,  600 as sales_amt, 100 as guestcount from dual 
    select storenbr
    ,       eow
    ,       sum(nvl(sales_amt, 0))                as sales_amount
    ,       sum(nvl(sales.guestcount , 0))      as guestcount
    from report_stores              stores
    inner join store_details        details   on details.storeid = stores.storeid
    right outer join sales_data     sales     on  sales.storeid = stores.storeid 
    inner join report_dates         dte       on    dte.businessdate =   to_date('01/24/2010', 'MM/DD/YYYY')
                                        --    and   sales.businessdate between   bow  and   eow
    group by storenbr, eow
    ;What am I doing wrong? For kicks I also tried switching the JOINS like :
    Select *
    from sales_data sales
    left outer join report_stores            stores on stores.stoeid = sales.storeid but couldn't make this work either.

    Hi,
    Thanks for posting the sample data in a useful form.
    Don't forget to post the results you want to get from that data. Is this what you want?
    STOR EOW         SALES_AMOUNT GUESTCOUNT
    6504                        0          0
    2385                        0          0
    4290                        0          0If so, you want to inner-join sales_data and report_dates, and then outer-join that result set to report_stores.
    Here's one way to do that:
    SELECT    details.storenbr
    ,         dte.eow
    ,         NVL (SUM (sales.sales_amt),  0)       AS sales_amount
    ,         NVL (SUM (sales.guestcount), 0)       AS guestcount
    FROM           report_stores   stores
    INNER JOIN      store_details      details          ON     details.storeid        = stores.storeid
    LEFT OUTER JOIN (     sales_data      sales
                      JOIN     report_dates    dte         ON      sales.businessdate  BETWEEN   dte.bow 
                                                           AND           dte.eow
              )                      ON       sales.storeid          = stores.storeid
    GROUP BY  details.storenbr
    ,             dte.eow
    ;As in your first query, you want the every row in report_stores to appear in the output, whether it matches anything in sales+dte or not, so you want to continue saying "FROM report_stores ... *LEFT* OUTER JOIN ...".
    You'll notice that I changed
    SUM (NVL (x, 0)) to
    NVL (SUM (x), 0). Both give the same results, but, if you have 1000 rows, the former calls NVL 1000 times, but the latter only calls NVL once, so it's more efficient.

  • Results to table powershell

    in our monitoring system we havent installed windows excel hence we are unble to run the below script. i am new to powershell can any one help me to change the scrit to update the results to sql server database table ?
    <#=================================
    # Generated On: 02/04/2014
    # Generated By: Prashanth Jayaram
    # Version     : 1.1
    # Desc        : SQL Inventory Generation
    # Change    : Added Named Instance column
    # EXAMPLE :
    PS:\>.\SQLServerInventory.ps1 -InputFileName c:\server.txt -DirectoryToSaveTo C:\  -To
    [email protected] -From
    [email protected]
    -SMTP mail.app.com
    #=================================
    #>
    [CmdletBinding()]
    Param(
      [Parameter(Mandatory=$True,Position=1)]
       [string]$InputFileName,
       [Parameter(Mandatory=$True,Position=2)]
       [string]$DirectoryToSaveTo,
       [Parameter(Mandatory=$True,Position=3)]
       [string]$To,
       [Parameter(Mandatory=$True,Position=4)]
       [string]$From,
       [Parameter(Mandatory=$True,Position=5)]
       [string]$SMTP
    $Filename='SQLInventory'
    # before we do anything else, are we likely to be able to save the file?
    # if the directory doesn't exist, then create it
    if (!(Test-Path -path "$DirectoryToSaveTo")) #create it if not existing
      New-Item "$DirectoryToSaveTo" -type directory | out-null
    #Create a new Excel object using COM
    $Excel = New-Object -ComObject Excel.Application
    $Excel.visible = $True
    $Excel = $Excel.Workbooks.Add()
    $Sheet = $Excel.Worksheets.Item(1)
    #Counter variable for rows
    $intRow = 1
    $xlOpenXMLWorkbook=[int]51
    #Read thru the contents of the SQL_Servers.txt file
    $Sheet.Cells.Item($intRow,1)  ="InstanceName"
    $Sheet.Cells.Item($intRow,2)  ="ComputerNamePhysicalNetBIOS"
    $Sheet.Cells.Item($intRow,3)  ="NetName"
    $Sheet.Cells.Item($intRow,4)  ="OS"
    $Sheet.Cells.Item($intRow,5)  ="OSVersion"
    $Sheet.Cells.Item($intRow,6)  ="Platform"
    $Sheet.Cells.Item($intRow,7)  ="Product"
    $Sheet.Cells.Item($intRow,8)  ="edition"
    $Sheet.Cells.Item($intRow,9)  ="Version"
    $Sheet.Cells.Item($intRow,10)  ="VersionString"
    $Sheet.Cells.Item($intRow,11) ="ProductLevel"
    $Sheet.Cells.Item($intRow,12) ="DatabaseCount"
    $Sheet.Cells.Item($intRow,13) ="HasNullSaPassword"
    $Sheet.Cells.Item($intRow,14) ="IsCaseSensitive"
    $Sheet.Cells.Item($intRow,15) ="IsFullTextInstalled"
    $Sheet.Cells.Item($intRow,16) ="Language"
    $Sheet.Cells.Item($intRow,17) ="LoginMode"
    $Sheet.Cells.Item($intRow,18) ="Processors"
    $Sheet.Cells.Item($intRow,19) ="PhysicalMemory"
    $Sheet.Cells.Item($intRow,10) ="MaxMemory"
    $Sheet.Cells.Item($intRow,21) ="MinMemory"
    $Sheet.Cells.Item($intRow,22) ="IsSingleUser"
    $Sheet.Cells.Item($intRow,23) ="IsClustered"
    $Sheet.Cells.Item($intRow,24) ="Collation"
    $Sheet.Cells.Item($intRow,25) ="MasterDBLogPath"
    $Sheet.Cells.Item($intRow,26) ="MasterDBPath"
    $Sheet.Cells.Item($intRow,27) ="ErrorLogPath"
    $Sheet.Cells.Item($intRow,28) ="BackupDirectory"
    $Sheet.Cells.Item($intRow,29) ="DefaultLog"
    $Sheet.Cells.Item($intRow,20) ="ResourceLastUpdatetime"
    $Sheet.Cells.Item($intRow,31) ="AuditLevel"
    $Sheet.Cells.Item($intRow,32) ="DefaultFile"
    $Sheet.Cells.Item($intRow,33) ="xp_cmdshell"
    $Sheet.Cells.Item($intRow,34) ="Domain"
    $Sheet.Cells.Item($intRow,35) ="IPAddress"
      for ($col = 1; $col –le 34; $col++)
              $Sheet.Cells.Item($intRow,$col).Font.Bold = $True
              $Sheet.Cells.Item($intRow,$col).Interior.ColorIndex = 48
              $Sheet.Cells.Item($intRow,$col).Font.ColorIndex = 34
    $intRow++
    foreach ($instanceName in Get-Content $InputFileName)
    [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | out-null
    $server1 = New-Object -Type Microsoft.SqlServer.Management.Smo.Server -ArgumentList $instanceName
    $s=$server1.Information.Properties |Select Name, Value
    $st=$server1.Settings.Properties |Select Name, Value
    $CP=$server1.Configuration.Properties |Select DisplayName, Description, RunValue, ConfigValue
    $dbs=$server1.Databases.count
    $BuildNumber=$s | where {$_.name -eq "BuildNumber"}|select value
    $edition=$s | where {$_.name -eq "edition"}|select value
    $ErrorLogPath =$s | where {$_.name -eq "ErrorLogPath"}|select value
    $HasNullSaPassword =$s | where {$_.name -eq "HasNullSaPassword"}|select value
    $IsCaseSensitive =$s | where {$_.name -eq "IsCaseSensitive"}|select value
    $Platform =$s | where {$_.name -eq "Platform"}|select value
    $IsFullTextInstalled =$s | where {$_.name -eq "IsFullTextInstalled"}|select value
    $Language =$s | where {$_.name -eq "Language"}|select value
    $MasterDBLogPath =$s | where {$_.name -eq "MasterDBLogPath"}|select value
    $MasterDBPath =$s | where {$_.name -eq "MasterDBPath"}|select value
    $NetName =$s | where {$_.name -eq "NetName"}|select value
    $OSVersion =$s | where {$_.name -eq "OSVersion"}|select value
    $PhysicalMemory =$s | where {$_.name -eq "PhysicalMemory"}|select value
    $Processors =$s | where {$_.name -eq "Processors"}|select value
    $IsSingleUser =$s | where {$_.name -eq "IsSingleUser"}|select value
    $Product =$s | where {$_.name -eq "Product"}|select value
    $VersionString =$s | where {$_.name -eq "VersionString"}|select value
    $Collation =$s | where {$_.name -eq "Collation"}|select value
    $IsClustered =$s | where {$_.name -eq "IsClustered"}|select value
    $ProductLevel =$s | where {$_.name -eq "ProductLevel"}|select value
    $ComputerNamePhysicalNetBIOS =$s | where {$_.name -eq "ComputerNamePhysicalNetBIOS"}|select value
    $ResourceLastUpdateDateTime =$s | where {$_.name -eq "ResourceLastUpdateDateTime"}|select value
    $AuditLevel =$st | where {$_.name -eq "AuditLevel"}|select value
    $BackupDirectory =$st | where {$_.name -eq "BackupDirectory"}|select value
    $DefaultFile =$st | where {$_.name -eq "DefaultFile"}|select value
    $DefaultLog =$st | where {$_.name -eq "DefaultLog"}|select value
    $LoginMode =$st | where {$_.name -eq "LoginMode"}|select value
    $min=$CP | where {$_.Displayname -like "*min server memory*"}|select configValue
    $max=$CP | where {$_.Displayname -like "*max server memory*"}|select configValue
    $xp_cmdshell=$CP | where {$_.Displayname -like "*xp_cmdshell*"}|select configValue
    $FQDN=[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain().Name
    $IPAddress=(Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $instanceName | ? {$_.IPEnabled}).ipaddress
    if ($HasNullSaPassword.value -eq $NULL)
     $HasNullSaPassword.value='No'
    if($DefaultFile.value -eq '')
     $DefaultFile.value='NA'
    if ($VersionString.value -like '8*')
     $SQLServer='SQL SERVER 2000'
    elseif ($VersionString.value -like '9*')
     $SQLServer='SQL SERVER 2005'
    elseif ($VersionString.value -like '10.0*')
     $SQLServer='SQL SERVER 2008'
    elseif ($VersionString.value -like '10.5*')
     $SQLServer='SQL SERVER 2008 R2'
    elseif ($VersionString.value -like '11*')
     $SQLServer='SQL SERVER 2012'
    else
     $SQLServer='Invalid'
    if ($OSVersion.value -like '5.0*')
     $OSVer='Windows 2000'
    elseif ($OSVersion.value -like '5.1*')
     $OSVer='Windows XP'
    elseif ($OSVersion.value -like '5.2*')
     $OSVer='Windows Server 2003'
    elseif ($OSVersion.value -like '6.0*')
     $OSVer='Windows Server 2008'
    elseif ($OSVersion.value -like '6.1*')
     $OSVer='Windows Server 2008 R2'
    elseif ($OSVersion.value -like '6.2*')
     $OSVer='Windows Server 2012'
    else
     $OSVer='NA'
     $Sheet.Cells.Item($intRow,1)   =$instanceName
            $Sheet.Cells.Item($intRow,2)   =$ComputerNamePhysicalNetBIOS.value
            $Sheet.Cells.Item($intRow,3)   =$NetName.value
            $Sheet.Cells.Item($intRow,4)   =$OSVer
            $Sheet.Cells.Item($intRow,5)   =$OSVersion.value
            $Sheet.Cells.Item($intRow,6)   = $Platform.value
            $Sheet.Cells.Item($intRow,7)   = $Product.value
            $Sheet.Cells.Item($intRow,8)   = $edition.value
            $Sheet.Cells.Item($intRow,9)   = $SQLServer
            $Sheet.Cells.Item($intRow,10)  = $VersionString.value
            $Sheet.Cells.Item($intRow,11)  = $ProductLevel.value
            $Sheet.Cells.Item($intRow,12)  = $Dbs
            $Sheet.Cells.Item($intRow,13)  = $HasNullSaPassword.value
            $Sheet.Cells.Item($intRow,14)  = $IsCaseSensitive.value
            $Sheet.Cells.Item($intRow,15)  = $IsFullTextInstalled.value
            $Sheet.Cells.Item($intRow,16)  = $Language.value
            $Sheet.Cells.Item($intRow,17)  = $LoginMode.value
            $Sheet.Cells.Item($intRow,18)  = $Processors.value
            $Sheet.Cells.Item($intRow,19)  = $PhysicalMemory.value
            $Sheet.Cells.Item($intRow,10)  = $Max.Configvalue
            $Sheet.Cells.Item($intRow,21)  = $Min.Configvalue
            $Sheet.Cells.Item($intRow,22)  = $IsSingleUser.value
            $Sheet.Cells.Item($intRow,23)  = $IsClustered.value
            $Sheet.Cells.Item($intRow,24)  = $Collation.value
            $Sheet.Cells.Item($intRow,25)  = $MasterDBLogPath.value
            $Sheet.Cells.Item($intRow,26)  = $MasterDBPath.value
            $Sheet.Cells.Item($intRow,27)  = $ErrorLogPath.value
            $Sheet.Cells.Item($intRow,28)  = $BackupDirectory.value
            $Sheet.Cells.Item($intRow,29)  = $DefaultLog.value
            $Sheet.Cells.Item($intRow,20)  = $ResourceLastUpdateDateTime.value
            $Sheet.Cells.Item($intRow,31)  = $AuditLevel.value
            $Sheet.Cells.Item($intRow,32) = $DefaultFile.value
            $Sheet.Cells.Item($intRow,33) = $xp_cmdshell.Configvalue
            $Sheet.Cells.Item($intRow,34) = $FQDN
            $Sheet.Cells.Item($intRow,35) = $IPAddress
    $intRow ++
    $filename = "$DirectoryToSaveTo$filename.xlsx"
    if (test-path $filename ) { rm $filename } #delete the file if it already exists
    $Sheet.UsedRange.EntireColumn.AutoFit()
    cls
    $Excel.SaveAs($filename, $xlOpenXMLWorkbook) #save as an XML Workbook (xslx)
    $Excel.Saved = $True
    $Excel.Close()
    Function sendEmail([string]$emailFrom, [string]$emailTo, [string]$subject,[string]$body,[string]$smtpServer,[string]$filePath)
    #initate message
    $email = New-Object System.Net.Mail.MailMessage
    $email.From = $emailFrom
    $email.To.Add($emailTo)
    $email.Subject = $subject
    $email.Body = $body
    # initiate email attachment
    $emailAttach = New-Object System.Net.Mail.Attachment $filePath
    $email.Attachments.Add($emailAttach)
    #initiate sending email
    $smtp = new-object Net.Mail.SmtpClient($smtpServer)
    $smtp.Send($email)
    #Call Function
    sendEmail -emailFrom $from -emailTo $to "SQL INVENTORY" "SQL INVENTORY DETAILS - COMPLETE DETAILS" -smtpServer $SMTP -filePath $filename

    The script you posted was created by Prashanth Jayaram who also has posted his script right here on the TechNet Gallery :
    PowerShell - SQL Inventory - Automatic - Excel File - EMAIL
    What you are asking us is to rewrite the script. Which I doubt anyone here will do.
    Maybe Prashanth Jayaram will help you if you ask him on the Gallery Question on his post.

Maybe you are looking for

  • MS Access Crosstab to Oracle SQL

    Gurus, I am trying to convert MS Access Query to Oracle SQL, What would be the Oracle query for this MS Access Crosstab Query? I am working on Oracle 10g so, I can't take advantage of oracle PIVOT function. Thank you Edited by: 951334 on Aug 10, 2012

  • Blackout with subtitles on Leopard. FR or Perian problem?

    I can't watch .avi files with .srt subtitle files on front row anymore. The screen goes black as the first subtitle appears. On Quicktime they run fine (thanks to Perian plug in), and they did run fine on Tiger Front Row. I first thought it was becau

  • I am losing my mind because everything I try never works!!!

    My iPod repeatedly shows an apple sign and a sad iPod face. I tried EVERY POSSIBLE THING I can think of but it didn't work. I tried: resetting, disk mode, restoring, different computer, updating iTunes,charging on wall charger or whatever it's called

  • Customizing the pushbutton control in 6.1

    How do I remove the LED portion of the pushbutton control in LV6.1? I tried to do a custom control but the LED can not be deleted. Anyone try to do this before?

  • I cant do compile any packages at all

    hi, I am trying to install yaourt... but it seems as if I can't; I cd in to the folder where the PKGBUILD file are in, I run makepkg PKGBUILD -si and I missing some dependencies... ofcourse I lookup it and cat install package query at all, I run the