CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2011
    Posts
    57

    How to exclude combinations of certain lines?

    I have a report that is grouped twice.

    At job then at task. I am trying to excluded when two fields are zero. But I get a mess of results.

    A b c

    GF2 task1 5 6 0
    GF2 task2 0 2 0
    GF2 task3 8 0 1
    GF2 task4 0 7 2

    GF1 Total 13 15 3

    How would I excluded line only task2? When A and C are zero?

    I tried at the GF2 but task(s) 1, 2 and 4 would disappear if I did " (Sum ({vdvProjectLines.numJobTRXNActlCost}, {vdvProjectLines.chrTaskNumber}) > 0
    and Sum ({vdvProjectLines.numJobTRXNRvEstSal}, {vdvProjectLines.chrTaskNumber}) > 0)"


    Thanks for your advice.
    PN
    Last edited by PNorm; March 21st, 2011 at 02:19 PM.

  2. #2
    Join Date
    Feb 2011
    Posts
    57

    Re: How to exclude combinations of certain lines?

    What does work is if I do:
    (Sum ({vdvProjectLines.numJobTRXNActlCost}, {vdvProjectLines.chrTaskNumber}) > 0.07
    or Sum ({vdvProjectLines.numJobTRXNRvEstSal}, {vdvProjectLines.chrTaskNumber}) > 0.07)


    For task2: I found that the amount was .07 which rounded up to 0. But this is contrary to sql logic. This statement is almost like at the group selection: "Only include records that match our clause of >.07 for column a or > .07 for column c. "

    Anyone have simple explanation for this?

  3. #3
    Join Date
    Feb 2011
    Posts
    57

    Re: How to exclude combinations of certain lines?

    Ok to close found that this acceptable tolerance on the report.

    Thank you.

  4. #4
    Join Date
    Jul 2005
    Posts
    1,083

    Re: How to exclude combinations of certain lines?

    If You want to supress when a=0 and c=0 then write the next code
    Code:
    (Sum ({vdvProjectLines.numJobTRXNActlCost}, {vdvProjectLines.chrTaskNumber}) = 0 AND 
    (Sum ({vdvProjectLines.numJobTRXNRvEstSal}, {vdvProjectLines.chrTaskNumber}) = 0)
    Or

    If You want to print when a<>0 or c<>0 then write the next code
    Code:
    (Sum ({vdvProjectLines.numJobTRXNActlCost}, {vdvProjectLines.chrTaskNumber}) <> 0 OR 
    (Sum ({vdvProjectLines.numJobTRXNRvEstSal}, {vdvProjectLines.chrTaskNumber}) <> 0)
    JG

  5. #5
    Join Date
    May 2003
    Location
    Islamabad, Pakistan
    Posts
    284

    Re: How to exclude combinations of certain lines?

    jggtz is right.

    Another simple solution just to see how many fields are zero:

    In the suppress formula you can place a check
    zero_fields := 0;

    if a = 0 then
    zero_fields := zero_fields + 1;

    if b = 0 then
    zero_fields := zero_fields + 1;

    if c = 0 then
    zero_fields := zero_fields + 1;

    if d = 0 then
    zero_fields := zero_fields + 1;

    if zero_fields >= 2 then
    true
    else
    false;
    If this post is helpful, then, Rate this Post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured