Report Builder (expression builder syntax)

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Report Builder (expression builder syntax)

    I'm trying to create a calculated field that will compare the values from one
    query field and depending on the values will assign a value to the calculated
    field. In crystal reports here is the syntax I used.

    IF ({AttendDet.AttendCode} = 1 OR {AttendDet.AttendCode} = 2) THEN
    {AttendDet.TotAdjTime}
    ELSE
    0

    *Ludwig* Guest

  2. Similar Questions and Discussions

    1. Report Builder Sum
      I am trying to do the sum of a returned query. The only data I want to show is the sum, not every row in the query before the sum. How do I get this...
    2. report builder.
      The documentation that comes with the report builder in CFMX7 really sucks. There is not much out there on using the expression builder which has...
    3. Report builder.....
      Is it possible to pass a variable directly to a .cfr or Cold Fusion report? Thanks, Geno
    4. CF Reports expression builder use
      I'm sure I'm doing something stupid but I created a function in Expression Builder called Age. It is just the difference between to dates and looks...
    5. CF Report Builder
      I am trying to generate a pricelist report using the new CF 7 Report Builder. When I add an image to the reprt and try to dynamically build the...
  3. #2

    Default Re: Report Builder (expression builder syntax)

    Bump...
    *Ludwig* Guest

  4. #3

    Default Re: Report Builder (expression builder syntax)

    This is pretty straightforward CF script, but something to this effect
    should work

    iif((query.AttendCode EQ 1) OR (query.AttendCode EQ 2), query.TotAdjTime, 0)

    Dean

    "*Ludwig*" <webforumsuser@macromedia.com> wrote in message
    news:d04s32$7g1$1@forums.macromedia.com...
    > I'm trying to create a calculated field that will compare the values from
    one
    > query field and depending on the values will assign a value to the
    calculated
    > field. In crystal reports here is the syntax I used.
    >
    > IF ({AttendDet.AttendCode} = 1 OR {AttendDet.AttendCode} = 2) THEN
    > {AttendDet.TotAdjTime}
    > ELSE
    > 0
    >

    Dean Harmon Guest

  5. #4

    Default Re: Report Builder (expression builder syntax)

    Dean's example works for an integer value, but I need something like this to
    return strings instead. I have a list of first and last names with an optional
    alternate first name (for shortened names and nick-names). I want to
    concantinate the alternate name on to the original name with brackets
    surrounding the alternate name. I could do this in my query, but I am
    evaluating the flexibility of the report writer and this should be a fairly
    simple task to do - if I could figure out how to get it to work. If you take
    Dean's example and use strings, you'll get an error because it thinks the
    string is a variable. I've tried single quotes, double quotes, no quotes, and
    evaluate() without any success. Have I run across yet another bug, or am I
    doing something wrong. My code for trying this out is: iif((query.Emp_AltFname
    EQ '') OR (query.Emp_FName EQ 'Dennis'), 'Testing', 'Failed')

    jerm Guest

  6. #5

    Default Re: Report Builder (expression builder syntax)

    Found the issue with strings. The DE() function needs to be used. Working example is: iif((query.Emp_AltFname EQ '') OR (query.Emp_FName EQ 'Dennis'), de('Testing'), de('Failed'))


    jerm Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139