Professional Web Applications Themes

Report Builder (expression builder syntax) - Coldfusion - Getting Started

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...

  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. #2

    Default Re: Report Builder (expression builder syntax)

    Bump...
    *Ludwig* Guest

  3. #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*" <webforumsusermacromedia.com> wrote in message
    news:d04s32$7g1$1forums.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

  4. #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

  5. #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

Similar Threads

  1. Help! Expression Builder!!! Sorting!!!! So Confused
    By bwebb in forum Microsoft Access
    Replies: 0
    Last Post: March 4th, 01:33 PM
  2. Report Builder
    By rcepek in forum Macromedia ColdFusion
    Replies: 11
    Last Post: June 22nd, 05:55 PM
  3. CF MX 7 - Report Builder
    By HSC Canada in forum Macromedia ColdFusion
    Replies: 0
    Last Post: April 7th, 04:26 PM
  4. CF Reports expression builder use
    By JCox in forum Macromedia ColdFusion
    Replies: 3
    Last Post: February 28th, 08:39 PM
  5. CF Report Builder
    By NCMike in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: February 28th, 08:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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