Primary Group setting

If I have a user assigned to 2 groups, the first time they log on, they have to select a "primary" group....  This affects their settings, depending on which group they select.
When I assign the "primary group" within WGM under "GROUPS", it doesn't seem to take care of this issue.  They are still given a choice upon first time logon.
If I don't want to give them the choice, how can I set this myself?  In WGM?

Hi Mr. Hoffman,  thank you for the suggestion.
However, I'm not sure how to snapshot the record - unless you literally mean screen cap of each of the tabs likely to be changed?

Similar Messages

  • Storage 7410 CIFS primary group for a directory tree

    We're trying to achieve what are basically "folder-level quotas" so that a particular folder used by a particular set of users belonging to a particular Active Directory group is limited to a set quota. That's possible in Windows (and QFS for that matter). Is there any way to achieve this in our Storage 7410 cluster? I have explored setting a "primary group" for the file, but that doesn't seem to become inherited (as can the GID in posix) - it's set based on the "primary group" setting assigned to the USER.
    Basically, I'm asking how to set the NTFS equivalent of GID for a folder and have that "stick" to all subsequently created files/folders within that folder.
    Thanks!
    Charles

    Gcool wrote:Try using "adduser" (interactive version) instead and see if the behaviour remains the same.
    I used
    #sudo userdel -r mel
    to remove the account
    and then used
    #sudo adduser
    and went through the prompts
    by default it wanted to add the users group as primary and I accepted it
    everything went fine , no errors but yet again the
    cat /etc/group shows
    storage:x:95:john,mel
    scanner:x:96:john,mel
    power:x:98:john,mel
    nobody:x:99:
    users:x:100:john
    dbus:x:81:
    interestingly if I do
    #sudo id mel
    I get
    uid=1001(mel) gid=100(users) groups=100(users),7(lp),10(wheel),50(games),91(video),92(audio),93(optical),95(storage),96(scanner),98(power)
    I am officially freaked !

  • Userprefs don't depend on primary group?

    I have users (student1, student2, etc) setup in two groups each, (their grade: ie, "Grade3", and "Students")   For this problem, it doesn't matter what primary group I set for them.  They are asked upon logon, to choose "grade3" or "students" as their primary workgroup.
    It seems that user prefs I set will only take effect for the group that the user (ie, studen1) selects when they are presented with the choice when logging on, not both groups I set prefs.
    ie, I set "restrict website xyz.com" in group "grade3" (for all grade3 students) and set "restrict facebook.com" in group (students) for all students in the school.
    When a grade 3 student logs on, they are asked to select a workgroup: grade3 or student.   If they select grade3, they are only restricted from xyz.com, but not facebook, and if they select students, they are restricted from facebook, but not xyz.com.
    Is this normal, or am I doing something wrong?
    Should users not be members of more than one group?
    Which is best to make their primary group, "grade3" or "students"?

    You can achieve this using rs.exe
    Datasource name can be made dynamic by using expression based connection strings
    see
    http://blogs.msdn.com/b/johndesch/archive/2012/12/17/using-the-rs-exe-utility-to-deploy-a-report-server-project-and-shared-dataset.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Alternating colors with drilldown groups not showing in the primary group.

    Hi all,
    Not sure if it is possible in SSRS but... My alternating colors work in my row groups of the drilldown group, but I also want the primary group (in my screenshot category) to be colored as well. Is this possible at all when my structure is like below?

    Hi Yvanlathem,
    According to your description, you want to set the textbox background color only for the even rows within child group. Right?
    In this scenario, we can put expression into Fill tab in Textbox Properties. We can use IIF() and RowNumber() to make the background color only apply on the even rows. Try the expression below:
    =IIF(RowNumber("Parent Group Name") mod 2=0,"Color1","Color2")
    We have tested in our local environment. It looks like below:
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How do i use WGM or dcsl to change the primary groups of users, defined by another group?

    i've got a ton of users, whose primary group is "current student". they all belong to the other group "year 13"
    they've left school, so i thought it would be easy to do a search of users with GID equal to or containing the GID for "year 13" (in this case 1121) and then change their primary group to "left school"
    except that doesn't work. i can only search for them in WGM by primary group, it seems. therefore i cannot do any batch operations on a secondary group.
    so. how do i do this? is there a way of scripting dcsl to find users by 'other group' and then change the primary group attribute?
    i'm going to need to be doing a lot of this (changing the other gropus of a school full of students). bit stumped.
    help!

    ok. for some reason neitehr root nor my account (which is part of the open directory admin group) can make changes using dscl.
    when addingremoving users from groups, remember that teh UUID has to be added/removed too
    this is getting there:
    old=year11
    new=year12
    for item in `dscl /LDAPv3/127.0.0.1/ read /Groups/$old GroupMembership | cut -d: -f2`
    do
    echo $item
    UUID=`dsmemberutil getuuid -U $item`
    case "$UUID"
              in
              "There is no uuid for user $item")
                        echo "user $item need personal attention"
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembership $item
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 append /Groups/$new GroupMembers $UUID
                        if [ "`dsmemberutil checkmembership -U $item -G $new`" == "user is a member of the group" ]  ; then
                        echo "$item added to $new"
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembership $item
                        dscl -u diradmin -P 'somepassword'  /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembers $UUID
                                  if [ "`dsmemberutil checkmembership -U $item -G $old`" == "user is a member of the group" ]  ; then
                                  echo "removal of $item from $old failed"
                                  else
                                  echo "removal of $item from $old succeded"
                                  fi
                        else echo "append of $item to $new failed"
                        fi
              esac
    done

  • Is this a bug with grouping sets?

    Version is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    SQL> with data as
      2  (select rownum r, 'X' x, 1 n from dual connect by rownum <= 10)
      3  select x
      4       , sum(n) s
      5       , (select sum(1) from dual where dummy = x) t
      6  from data
      7  group by grouping sets (x, ())
      8  /
    X          S          T
    X         10          1
              10
    SQL>  Shouldn't the superaggregate row have a 1 in the T column?

    Here's your QUERY with the addition of the GROUPING() function:
    SQL> WITH data AS
      2  (
      3     SELECT rownum r
      4          , 'X'    x
      5          , 1      n
      6     FROM   dual
      7     CONNECT BY rownum <= 10
      8  )
      9  SELECT GROUPING(x)
    10       , x
    11       , sum(n) s
    12       , (SELECT sum(1) FROM dual WHERE dummy = x) t
    13  FROM   data
    14  GROUP BY GROUPING SETS (x, ())
    15  ;
    GROUPING(X) X          S          T
              0 X         10          1
              1           10In this case the value for X is null because it's a subtotal row. If you look at the execution plan for this statement:
    PLAN_TABLE_OUTPUT
    SQL_ID  gumphwvgumqc4, child number 0
    WITH data AS (  SELECT rownum r       , 'X'    x       , 1      n  FROM
      dual  CONNECT BY rownum <= 10 ) SELECT /*+gather_plan_statistics*/ x
        , sum(n) s      , (SELECT sum(1) FROM dual WHERE dummy = x) t FROM
    data GROUP BY GROUPING SETS (x, ())
    Plan hash value: 1718326399
    | Id  | Operation                       | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    |   0 | SELECT STATEMENT                |      |      1 |        |      2 |00:00:00.01 |       0 |    |  |          |
    |   1 |  SORT AGGREGATE                 |      |      2 |      1 |      2 |00:00:00.01 |       4 |    |  |          |
    |*  2 |   TABLE ACCESS FULL             | DUAL |      2 |      1 |      1 |00:00:00.01 |       4 |    |  |          |
    |   3 |  SORT GROUP BY ROLLUP           |      |      1 |      1 |      2 |00:00:00.01 |       0 |  2048 |  2048 | 2048  (0)|
    |   4 |   VIEW                          |      |      1 |      1 |     10 |00:00:00.01 |       0 |    |  |          |
    |   5 |    COUNT                        |      |      1 |        |     10 |00:00:00.01 |       0 |    |  |          |
    |   6 |     CONNECT BY WITHOUT FILTERING|      |      1 |        |     10 |00:00:00.01 |       0 |    |  |          |
    |   7 |      FAST DUAL                  |      |      1 |      1 |      1 |00:00:00.01 |       0 |    |  |          |
    Predicate Information (identified by operation id):
       2 - filter("DUMMY"=:B1)The value for X is being bound to the subquery. If X is null this won't return any rows (I'm sure you knew that :) ). I would say this is expected albeit confusing behavior. You get the same results if you use CUBE or ROLLUP as well.

  • Isse with using Grouping Sets in SQL Server 2008 R2

    Hi,
    I created a query in SQL Server 2012 using grouping sets that works fine.  When I try to use the same query in SQL Server 2008 I get an error ("Inccorrect syntax near SETS").
    I researched using grouping sets in 2008 and didn't see any issue with my query.  What is different in grouping sets 2008 vs 2012?
    SELECT tl.ClientRegionCd as [Client Region Code] , tl.ClientRegionDesc as [Region Name], count(tl.CompleteICN) as [Trauma Letters Sent]
    from TORT_Trauma_Letters tl
    Where CONVERT(VARCHAR(26), tl.SecondNoticeSent, 23) between '2014-06-12' and '2014-06-12'
    GROUP BY GROUPING SETS((tl.ClientRegionCd, tl.ClientRegionDesc), ())
    Stacie

    Check this blog post as how to deal with date ranges
    http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
    For your result you can simply achieve your result with UNION ALL, e.g.
    select Client, Region, Letters
    from myTable 
    UNION ALL
    select NULL, NULL, SUM(letters) as Letters
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • OrgChart - Group setting not respected when default hierarchy clicked

    Does anyone else get this problem in OrgChart (staged)?
    If a group is defined and set to u201CGroupu201D via the settings panel by the end user, then clicking the default root icon then the resulting hierarchy starts at the default root but without members grouped. 
    If the settings panel is opened, the group setting is still u201CGroupu201D (as expected).  Simply clicking u201CApply settingsu201D does result in the members being grouped.
    Looks like a bug to me, anyone else able to replicate?

    Hey Stephen,
    This funcitonality should work as expected.
    First, please verify that youset up groups from the admin first? If not, you should do it before doing anything from settings.
    From the setting when you select u201CGroupu201D u2013 you will see the grouping, the nodes will be grouped; when you select u201CShow Group Membersu201D u2013 the group will be expanded; when you select u201CHide Group Membersu201D u2013 the box with this group will disappear from the OrgChart.
    Once this is setup, if you are still experiencing issues, verify the CDS log, as it may be a permissions issue (ie no write or modify access for user settings).
    Hope this helps
    Carl

  • My icloud email address is included in a friend's address group set up in Gmail.  When they send an email to the group, the email never gets through to my icloud address - why?

    My icloud email address is included in a friend's address group set up in Gmail.  When they send an email to the group, the email never gets through to my icloud address - why?

    They've always been able to send to me individually - just not when my email is part of a group or even when it's just included with several other addresses added one at a time.

  • Is there any way to change "Primary/Reporing Set of books " option in SOB

    Hi,
    Is thier any way , to change the primary/reporting set of books option , which is enabled in MULTIPLE REPORTING CURRENCY TAB in "Set of Books" winow in Financial applications.
    Once defined , I was not able to change the option.
    Rgds

    Looks like more of the functional issue.
    Sumit,
    It will be good if you can provide the link of that thread in financial forum which you replied. That will maintain the link :)
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                               

  • How to sort specific column when using GROUPING SETS in SQL Server?

    If I remember correctly, in SQL Server, it is not recommended to use "ORDER BY" when there's already a GROUP BY GROUPING SETS.
    I have two columns: [UPC#] & [Description] both are varchar.
    My grouping sets is like this:
    GROUP BY
    GROUPING SETS
    ([UPC],[Description])
    I don't have 'ORDER BY' but it's automatically sorting the Description column.
    If I added a 3rd column, sum(Qty), then it doesn't sort by Description anymore. But if I added
    ORDER BY [Description]
    then the grand total of sum(Qty) will be at the first row instead of the last.
    Is there a way to sort the Description column and still let the grand total of sum(Qty) be at the last row instead?
    Thanks.

    Yes, it works.
    Thank you.
    Could you kindly explain the logic?
    I don't quite understand the "= 3 THEN 1 ELSE 0" part.
    Is the #3 mean the column index 3?
    GROUPING_ID returns a bit mask value depending on number of columns grouped in the result 
    So when you do GROUPING_ID(([UPC]),([Description]))
    it has two columns UPC and Description so bit mask will be as follows
    0 ie 00 for rows grouped by both UPC and Description fields
    1 ie 01 for rows grouped by UPC ie UPC subtotals
    2 ie 10 for rows grouped by Description ie Description subtotals
    3 ie 11 for rows not grouped by both columns ie Grand total
    see
    http://msdn.microsoft.com/en-IN/library/bb510624.aspx
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Group by Grouping sets in obiee11g query

    Hi Experts
    I have few unbalanced heirarchies in the rpd. I have created level beased heirarchy for those ragged and skipped hierarchy but while generating the report using those hierarchy generates a huge SQL involving 20-30 UNION ALLs . Instead it should have generated comparatively smaller query using Group by Grouping Sets but it is not.
    I have also tried enabling this parameter in DB properties in OBIEE11g ( changed the default DB from 9i to 11g in obiapps 7.9.6.3 rpd) but still no use .
    As a result of huge query geenration the performance is badly impacted.
    Any thought on this pls.

    I have run into the same problem. Any hints about what might be the reason or, even better, how to address it, will be more than welcome.
    thanks in advance

  • GROUP BY grouping sets

    Hello everybody,
    I have this query
    SELECT ALL
                M_PAGAMENTO||' '||D_TIPO MPAGA,
                grouping(F.KIND_F),
                DECODE (grouping(F.KIND_F), 0 , 'Totali IVA',F.KIND_F)  a1,
                 case
                 when grouping(F.KIND_F) = 1 then F.KIND_F
                 when grouping(F.KIND_F) = 0 then 'Totali IVA'
                 end  TIPOF,
               F.KIND_F  TIPOF,
               COUNT(*) NFATTURE,
                sum(F.TOT_FT) TFATTURA, sum(F.BOLLO) TBOLLO,
                K_IVA, SUM(FA.IPBFA) TIMP, SUM(FA.IPSFA) TIPS
    FROM A_FATTURE  F,A_PAZIENTI A,TIPOLOGIA_PAGAMENTI p  ,A_FATTURE_ALIQUOTE FA
    where (F.TIPORD = A.TIPORD AND F.K_CODE = A.K_CODE  AND F.ANNO = A.ANNO)
    AND   (FA.TIPORD = F.TIPORD AND FA.K_CODE = F.K_CODE AND FA.ANNO = F.ANNO AND FA.N_FATT_D = F.N_FATT_D)
    and p.ID_TIPO = f.M_PAGAMENTO
    &MYWHERE
    GROUP BY grouping sets (M_PAGAMENTO||' '||D_TIPO,F.KIND_F),K_IVA
    ORDER by  1
    Why I get this result(A1, tipof) = NULL but they would be = 'D' (F.KIND_F ='D'
    MPAGA                    GROUPING(F.KIND_F)     A1     TIPOF     TIPOF     NFATTURE     TFATTURA     TBOLL      K_IVA     TIMP          TIPS
    01 Contante               1                              5          3183,24          7,24     20     250          50
    01 Contante               1                              3          2342,43          5,43     FC     5,43          0
    01 Contante               1                              50          7024,61          9,91     ES     24458,91     0
    02 Assegno               1                              1          780,81          1,81     FC     1,81          0
    02 Assegno               1                              2          816,96          1,81     ES     755,15          0
    02 Assegno               1                              1          780,81          1,81     20     50          10
    04 Carta di credito          1                              1          780,81          1,81     FC     1,81          0
    04 Carta di credito          1                              1          780,81          1,81     20     50          10
    04 Carta di credito          1                              1          780,81          1,81     ES     719          0
                        0     Totali IVA     Totali IVA     D     53          8622,37          23,53     ES     25933,06     0
                        0     Totali IVA     Totali IVA     D     5          3904,05          9,05     FC     9,05          0
                        0     Totali IVA     Totali IVA     D     7          4744,86          10,86     20     350          70where I am wrong?
    thanks for any help

    Rosario,
    Those rows where grouping(f.kind_f) = 1 are superaggregate rows where you are grouping by M_PAGAMENTO||' '||D_TIPO,K_IVA. So f.kind_f doesn't come into play for these rows, and it shows a null value.
    You can of course hard code a 'D' value in there, but values of the f.kind_f column are always null at this grouping level.
    See this example:
    SQL> select deptno
      2       , job
      3       , extract(year from hiredate)
      4       , sum(sal)
      5       , grouping(job)
      6    from emp
      7   group by deptno
      8       , grouping sets (job,extract(year from hiredate))
      9  /
        DEPTNO JOB       EXTRACT(YEARFROMHIREDATE)   SUM(SAL) GROUPING(JOB)
            10 CLERK                                     1300             0
            10 MANAGER                                   2450             0
            10 PRESIDENT                                 5000             0
            20 CLERK                                     1900             0
            20 ANALYST                                   6000             0
            20 MANAGER                                   2975             0
            30 CLERK                                      950             0
            30 MANAGER                                   2850             0
            30 SALESMAN                                  5600             0
            10                                1981       7450             1
            10                                1982       1300             1
            20                                1980        800             1
            20                                1981       5975             1
            20                                1982       3000             1
            20                                1983       1100             1
            30                                1981       9400             1
    16 rijen zijn geselecteerd.
    SQL> select deptno
      2       , job
      3       , extract(year from hiredate)
      4       , sum(sal)
      5       , grouping(job)
      6       , decode(grouping(job),1,job)
      7    from emp
      8   group by deptno
      9       , grouping sets (job,extract(year from hiredate))
    10  /
        DEPTNO JOB       EXTRACT(YEARFROMHIREDATE)   SUM(SAL) GROUPING(JOB) DECODE(GR
            10 CLERK                                     1300             0
            10 MANAGER                                   2450             0
            10 PRESIDENT                                 5000             0
            20 CLERK                                     1900             0
            20 ANALYST                                   6000             0
            20 MANAGER                                   2975             0
            30 CLERK                                      950             0
            30 MANAGER                                   2850             0
            30 SALESMAN                                  5600             0
            10                                1981       7450             1
            10                                1982       1300             1
            20                                1980        800             1
            20                                1981       5975             1
            20                                1982       3000             1
            20                                1983       1100             1
            30                                1981       9400             1
    16 rijen zijn geselecteerd.Regards,
    Rob.

  • GROUP BY GROUPING SETS Clarification of Format

    Hello.
    I am trying to validate the answers to 2 questions I have listed below.
    Would it be possible for someone to assist me with clarifying these 2 questions and answer statements? Please clarify the portion of the answer that is in
    Bold Text and Italicized. Why is one answer enclosed in brackets and the other not?
    Basically I need to figure out how to determine the syntax of these parenthesis and why they differ from each question. Is it a format issue or is it based on how the question is asked.
    Question #1-
    You are a developer for a Microsoft SQL Server 2008 R2 database instance used to support a customer service application. 
    You create tables named complaint, customer, and product as follows: 
    CREATE TABLE [dbo].[complaint] ([ComplaintID] [int], [ProductID] [int], [CustomerID] [int], [ComplaintDate] [datetime]); 
    CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100), [Address] [varchar](200), [City] [varchar](100), [State] [varchar](50), [ZipCode] [varchar](5)); 
    CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), [SalePrice] [money], [ManufacturerName] [varchar](100)); 
    You need to write a query to sum the sales made to each customer who has made a complaint by the following entries:
    ·Each customer name
    ·Each product name
    ·The grand total of all sales 
    Which SQL query should you use?
    SELECT c.CustomerName, p.ProductName, SUM(p.SalePrice) AS Sales
    FROM product p 
    INNER JOIN complaint com ON p.ProductID = com.ProductID 
    INNER JOIN customer c ON com.CustomerID = c.CustomerID
    GROUP BY GROUPING SETS ((c.CustomerName), (p.ProductName), ());
    Question #2 - 
    You are a developer for a Microsoft SQL Server 2008 R2 database instance. 
    You create tables named order, customer, and product as follows: 
    CREATE TABLE [dbo].[order] ([OrderID] [int], [ProductID] [int], [CustomerID] [int],[OrderDate] [datetime]); 
    CREATE TABLE [dbo].[customer] ([CustomerID] [int], [CustomerName] [varchar](100),[Address] [varchar](200), [City] [varchar](100), [State] [varchar](50),
    [ZipCode] [varchar](5)); 
    CREATE TABLE [dbo].[product] ([ProductID] [int], [ProductName] [varchar](100), [SalePrice] [money], [ManufacturerName] [varchar](100)); 
    You need to write a query to sum the sales made to each customer by the following entries:
    ·The Customer name and product name
    ·The grand total of all sales
     Which SQL query should you use?
    SELECT c.CustomerName,p.ProductName,SUM(p.SalePrice) AS Sales
    FROM product p 
    INNER JOIN [order] o ON p.ProductID = o.ProductID 
    INNER JOIN customer c ON o.CustomerID = CustomerID
    GROUP BY GROUPING SETS ((c.CustomerName, p.ProductName), ());
    Your help would be highly appreciated. :)
    Thanks

    Its just to identify the GROUPING SET.When you enclose, the grouping would take for the combination.
    Ok, it would be better to see with an example as below:
    create table T1 (Col1 Varchar(100),Col2 int,Col3 int)
    Insert into T1 Select 'SQL',10,100
    Insert into T1 Select 'SQL',11,100
    Insert into T1 Select 'Oracle',20,500
    SELECT p.col1,p.col2,SUM(p.col3) AS Sales
    FROM T1 p
    GROUP BY GROUPING SETS ((p.Col1,p.Col2), ());/*Oracle 20 500
    SQL 10 100
    SQL 11 100
    NULL NULL 700*/
    SELECT p.col1,p.col2,SUM(p.col3) AS Sales
    FROM T1 p
    GROUP BY GROUPING SETS ((p.Col1),(p.Col2), ());
    /*NULL 10 100
    NULL 11 100
    NULL 20 500
    NULL NULL 700
    Oracle NULL 500
    SQL NULL 200*/
    Drop table T1

  • GROUP BY GROUPING SETS for a selected month and for year to date

    Below is a code example to demonstrate this question:
    declare @test table (ID int, Quantity int, Day date);
    insert into @test values
    (4, 500, '1/18/2014'),
    (4, 550, '1/28/2014'),
    (7, 600, '1/10/2014'),
    (7, 750, '1/11/2014'),
    (7, 800, '1/20/2014'),
    (1, 100, '1/2/2014'),
    (1, 125, '1/10/2014'),
    (8, 300, '1/7/2014'),
    (9, 200, '1/17/2014'),
    (9, 100, '1/22/2014'),
    (4, 900, '2/18/2014'),
    (4, 550, '2/28/2014'),
    (7, 600, '2/10/2014'),
    (7, 700, '2/11/2014'),
    (7, 800, '2/20/2014'),
    (1, 100, '2/2/2014'),
    (1, 150, '2/10/2014'),
    (8, 300, '2/7/2014'),
    (9, 200, '2/17/2014'),
    (9, 100, '2/22/2014'),
    (4, 500, '3/18/2014'),
    (4, 550, '3/28/2014'),
    (7, 600, '3/10/2014'),
    (7, 750, '3/11/2014'),
    (7, 800, '3/20/2014'),
    (1, 100, '3/2/2014'),
    (1, 325, '3/10/2014'),
    (8, 300, '3/7/2014'),
    (9, 200, '3/17/2014'),
    (9, 100, '3/22/2014'),
    (4, 500, '4/18/2014'),
    (4, 550, '4/28/2014'),
    (7, 100, '4/10/2014'),
    (7, 750, '4/11/2014'),
    (7, 800, '4/20/2014'),
    (1, 100, '4/2/2014'),
    (1, 325, '4/10/2014'),
    (8, 300, '4/7/2014'),
    (9, 200, '4/17/2014'),
    (9, 100, '4/22/2014'),
    (4, 500, '5/18/2014'),
    (4, 550, '5/28/2014'),
    (7, 600, '5/10/2014'),
    (7, 750, '5/11/2014'),
    (7, 50, '5/20/2014'),
    (1, 100, '5/2/2014'),
    (1, 325, '5/10/2014'),
    (8, 300, '5/7/2014'),
    (9, 200, '5/17/2014'),
    (9, 100, '5/22/2014');
    --detail
    select *
    from @test;
    --aggregation
    select
    TotalQuantity = sum(Quantity),
    [Month] = month(Day)
    from @test
    group by
    grouping sets
    (month(Day)),
    (year(Day))
    go
    This is the aggregation query result:
    However, the desired result is to return only two rows: one row for month 3 and the other row for year to date (in the picture above YTD is the row that appears with {null} in the Month column).  Is there a way to achieve this goal by modifying the
    sample code above?  The requirement is to only read the data once (do not want a solution that involves a UNION which implies reading the data twice).

    you can add required filters in having clause. Here is the query -
    select
    TotalQuantity = sum(Quantity),
    [Month] = month(Day)
    from @test
    group by
    grouping sets
    (month(Day)),
    (year(Day))
    having
    month(Day) = 3 or month(Day) is null;

Maybe you are looking for

  • ICloud setup for Family to only share Apps

    Okay, so I've tried reading through several different articles to figure this out but I'm not getting anywhere so I'm hoping there's somewhere here with a similiar setup that can just give the basic setup. So here's what I want to do, I want to be ab

  • How to get back from Show form  to Render List  form in XML Forms

    Hi, As we use the Hyperlink "Display" in RenderList form to go to Show form similarly what kind of hyperlink shoul we use in Show Forms to get back to RenderList Forms. We did try out with the Back option but are not getteing the desired result. Swet

  • How to Play Downloaded PBS Episode on Widescreen TV?

    How do I play a downloaded PBS video ("Endeavor") on my widescreen TV?  I used the itunes PBS app to access the episode and have it on my Ipod touch, version5.1.1 (9B206), Model MC008LL.  Itplays fine on the Ipod, but I want to view it on my Samsung

  • Sun JSF 1.2 (RI) + MyFaces  project Tomahawk 1.1.3

    Hi Guys, I wondering if someone can help me out. I'm so lost... In general, I'm working in a new project using Tomcat 5.5.17 as Servlet container, NetBeans as IDE and Sun JSF 1.2 (RI) Framework. The combination of Tomcat and JFS 1.2 already is an iss

  • Network Model

    Does anyone know of an effective way of representing a live network in Java such as in the form of a TreeModel of any kind of model. I don't believe that the NetworkInterface class is adequate for accomplishing this.