How can i output the max average?

How can i output the max of the average?
i have this queries...
<cfquery datasource="Intranet" name="GroupStars">
        SELECT execoffice_status, employeedept, COUNT(*) as 'totalstars'
        FROM CSEReduxResponses
        WHERE execoffice_status = 1
        GROUP BY execoffice_status, employeedept
    </cfquery>
    <cfquery dbtype="query" name="GetTotalStars">
        SELECT *
        FROM GroupStars, GetDepartments
        WHERE GroupStars.employeedept = GetDepartments.csedept_id
    </cfquery>
<cfif GetTotalStars.RecordCount gt 0>
    <cfquery datasource="PhoneList" name="GetAllData">
        SELECT dept.csedept_id, COUNT(*) as 'totalcount'
        FROM employee, dept
        WHERE employee.dept_id = dept.dept_id
            AND employee.emp_status = 1
            AND dept.csedept_id is not null
        GROUP BY dept.csedept_id
    </cfquery>
    <cfquery dbtype="query" name="GetDepartmentTotalEmployeesCount">
        SELECT *
        FROM GetAllData, GetDepartments
        WHERE GetAllData.csedept_id = GetDepartments.csedept_id
    </cfquery>
<cfquery name="joinQuery" dbtype="query" >
SELECT *
FROM GetTotalStars
WHERE GetTotalStars.csedept_id = -1
</cfquery>
<cfset QueryAddRow(joinQuery)>
<cfquery name="GetUnion" dbtype="query" >
SELECT *
FROM GetDepartmentTotalEmployeesCount, GetTotalStars
WHERE GetDepartmentTotalEmployeesCount.csedept_id = GetTotalStars.csedept_id
UNION
SELECT GetDepartmentTotalEmployeesCount.*, joinQuery.*
FROM GetDepartmentTotalEmployeesCount, joinQuery
WHERE GetDepartmentTotalEmployeesCount.csedept_id NOT IN (#ValueList(GetTotalStars.csedept_id)#)
</cfquery>
<cfquery datasource="Intranet" name="GroupStarsGiven">
    SELECT execoffice_status, submitterdept, COUNT(*) as 'totalstarsgiven'
    FROM CSEReduxResponses
    WHERE execoffice_status = 1
    GROUP BY execoffice_status, submitterdept
</cfquery>
<cfquery dbtype="query" name="GetTotalStarsGiven">
    SELECT *
    FROM GroupStarsGiven, GetDepartments
    WHERE GroupStarsGiven.submitterdept = GetDepartments.csedept_id
</cfquery>
<cfquery name="joinQuery2" dbtype="query" >
SELECT *
FROM GetTotalStarsGiven
WHERE GetTotalStarsGiven.csedept_id = -1
</cfquery>
<cfset QueryAddRow(joinQuery2)>
<cfquery name="GetUnion2" dbtype="query" >
SELECT *
FROM GetUnion, GetTotalStarsGiven
WHERE GetUnion.csedept_id = GetTotalStarsGiven.csedept_id
UNION
SELECT GetUnion.*, joinQuery2.*
FROM GetUnion, joinQuery2
WHERE GetUnion.csedept_id NOT IN (#ValueList(GetTotalStarsGiven.csedept_id)#)
ORDER BY csedept_name ASC
</cfquery>
and this part is where i calculate the average, but i only get the average for each department, and from here i want to get the max of the average. how can i do that?
<td><div align="right"><cfif totalstars eq ''>&ndash;<cfelse><cfset avgstars = totalstars / totalcount>#DecimalFormat(avgstars)#</cfif></div></td>
thanks for your help

1) What is it doing instead?
2) Can you repost your code, but use code tags? If you repaste your formated code and place the tag &#91;code&#93; on top of your block of code and then paste &#91;/code&#93; on the bottom of your block, your posted code will retain its formating and be readable.
Good luck

Similar Messages

  • How can i get the max rpm from cpu fan??

    how can i get the max rpm from my cpu cooler regarding that i don't have a speed controller attached to the cpu fan ,,, ??  please make things clear for me
    thanks

    if you have not reduced it by using a speed controller either hardware or software or by the 7v mod its already going as fast as it will at 12 v dc you cannot speed it up only slow it down
    need more air get a different cooler/fan

  • How can I output the alpha channel in Premiere elements 10

    How can I output the alpha channel in Premiere elements 10. What format should I use?
    Tried outputting to an AVI filet but the file did not contain an alpha channel that After Effects 5.5 would recognize.

    Bill,
    I hope you ordered 32 GB or more on that new computer After Effects 5.5 takes up as much as it can.
    The Roto Brush tool is really a timesaver over ordinary Rotoscoping. Although, my problem now is: when I try to send a 1 min. And 11 second video from Adobe Premier Pro 5.5 two Adobe Media encoder 5.5, the process hangs in wait state in the Media Encoder. I have filed a request for help on the Media Encoder forum.
    I know you will put your new computer to use in helping other people and for this I thank you.

  • How can you set the max row for a 'open cursor' in a stored proc?

    I would like to know how can you set the maximum amount of row returned in a resultset coming from a stored proc?
    You can do it via JDBC with cStatement.setMaxRows(10); but it works only for select that you do via JDBC...
    I would like the same functionality using open cursor inside a stored proc...
    Thanks...

    is "where ROWNUM <= 10" the equivalent of "cStatement.setMaxRows(10);" because the ROWNUM as problem with the ORDER BY clause and the setMaxRows() as no problem...

  • How can i find the max of a column using CMP

    I urgently need a solution to How one can find the maximum of a field which is of integer/numeric type??
    I am doing it in CMP + weblogic.
    Suppose the table is STUDENTMARKS which consists of a field
    TotalMarks of Integer type..
    and i need to find the student with maximum marks..
    Should i be using EJB QL.. If so pls tell how...

    U can use aggregate function max in ejb ql

  • How can I restrict the total no. of recs. per physical page

    Hi !
    I have created a report and I am saving that in a text file. The
    problem is that when I try to take the output on the printer
    then the total no of records overflows to the next pages and the
    next page heading comes much below to it's designated place.
    Max.no of records property in the repaeting frame is for the
    logical page.
    How can I restrict the max. number of records per physical page ?
    Any pointer will be welcome,
    Thanks in advance,
    Shobhit
    null

    Just for fun (and in case this wasn't done to death in the other thread), the rule posted here states:
    Most years have 365 days, but a leap year has 366 days. That adds up to 52 weeks (where each week is exactly 7 days) PLUS 1 or 2 additional days. The year 2012 has exactly 366 days.Now if the year starts on a Sunday in a non-leap year, you end up with 53 Sundays. Or if either of the first two days lands on a Sunday during a leap year, then you can also get 53 Sundays.>
    which allows a calculation like this:
    with test_data as
         ( select rownum + 1999 as test_year from dual
           connect by rownum <= 15 )
    select test_year
         , case
              when first_day = 'SUN'
              or ( first_day = 'SAT' and leap_year = 'Y' )
                 then 53
              else 52
           end as sundays
    from   ( select test_year
                  , to_char(to_date(d.test_year||'-01-01','YYYY-MM-DD'),'DY', 'NLS_DATE_LANGUAGE=ENGLISH') first_day
                  , case extract(day from last_day(to_date(d.test_year||'-02','YYYY-MM'))) when 29 then 'Y' else 'N' end as leap_year
             from   test_data d );
    TEST_YEAR    SUNDAYS
          2000         53
          2001         52
          2002         52
          2003         52
          2004         52
          2005         52
          2006         53
          2007         52
          2008         52
          2009         52
          2010         52
          2011         52
          2012         53
          2013         52
          2014         52
    15 rows selected.

  • When I import my Sony video, which is in m2ts format, the file size is a few times larger.  This affects the volume of clips for creating the blu-ray or DVD discs.  How can I squeeze the file size without sacrificing the quality of output?

    When I import my Sony video, which is in m2ts format, the file size is a few times larger.  This affects the volume of clips for creating the blu-ray or DVD discs.  How can I squeeze the file size without sacrificing the quality of output?  Is there any other ways of achieving this?

    wongrayd wrote:
    Thanks.  I do not have the experience on burning discs from iMovie for the movie after editing (ie for video discs players).  It seems that i cannot find the relevant command in the tool bar for this purpsoe.  Would you please show me the way?
    The command is gone because iDVD has been discontinued by Apple. After Apple discontinued iDVD they removed the iDVD burning link from iMovie. I still use iDVD sometimes, only because I have an old copy.
    wongrayd wrote:
    You have mentioned about Handbrake as a converter.  What is the RF no. (under Constant Quality) meant?  It seems that the smaller the no. is, the better quality will be.  What is the optimal no.? or should we use the Average Bitrate? Again, what is the best rate?  Furthermore, which format is more suitable or the best: H264 or mpeg 2/4?
    I don't know what RF means. When I have used HandBrake, I've used presets that apply to what I want to do, so I don't know the meaning of each individual setting. However, it appears that many of them are listed in the HandBrake User's Guide that is linked from the Help menu in the program:
    https://trac.handbrake.fr/wiki/HandBrakeGuide
    wongrayd wrote:
    For iMac, except iMovie, what other software is the best for the amateur?  I have read Photoshop.  Can this support m2ts files and user friendly?
    Photoshop is not amateur-level software, and although it can edit a video, it cannot burn a DVD. Unfortunately, because I still use iMovie, I haven't tried anything else. You might want to read the reviews of various DVD-burning applications in the Mac App Store.
    And maybe another forum member will jump in and help us here!

  • How can I specify the default tab in a CHM Output?

    My company uses CHM-based help for some of its products. We build the CHM files from RoboHelp 9, and while these CHM files don't really have a full Index attached to them, the Index tab shows up in the output anyway. Unfortunately, we are suddenly seeing that when the CHM file is launched from our program, the Index tab is displayed by default. We'd rather have the Contents tab be the default look, especially considering that the Index does not exist.
    I have poked around into how you can specify a default tab for a CHM file, and the only information I have found suggests that using a CHM file creates a file (HH.dat) that specifies which tab should be displayed on a user-by-user basis, and that the last tab displayed when you close the CHM should be the first one displayed when you re-open it. While this is true if you open the CHM independent from the product, when you launch it from our program, it's all Index, all the time.
    So, my question is: How can I specify the default tab for a CHM file? Or, failing that, how can I excise the Index tab from my CHM output.

    Hi there
    This will be something up to your application developer to resolve. When s/he issues the call to open the CHM, there are parameters that may be used to always open with the desired tab "in front".
    Point your developer to the link below and advise that s/he is most likely interested in the section titled: Programming Tips.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How can i get the Icons in the output of ALV?

    Hi,
    I am trying to get the Icons in my report output using ALVs.
    i am adding the following line
       line_fieldcat-icon = 'ICON_GREEN_LIGHT'. in my field catalog for getting the respective Icon in the list. but the Icon is not getting displayed?
    May i know whether the above specified line is correct or not? if not, how can i get the Icons in my output using ALVs?
    Thanks and regards,
    Ramesh.

    Hi,
    take idea from this code :
    INCLUDE ICONs.
    WRITE : / icon_green_light AS ICON.
    WRITE : / icon_red_light AS ICON.
    write : / icon_yellow_light AS ICON.
    OR
    add code as per steps below in your ALV report :
    <b>FIRST :</b>
    INCLUDE ICONs.
    <b>Second :</b> in your internal table add : 
    icon type icon-id,
    <b>Third :</b>
    add this value in icon field for green light.
    itab-icon =  '@08@'.
    append itab.
    <b>Fourth :</b> display
    is_fieldcat-tabname     = 'IT_FINAL'.
    is_fieldcat-fieldname   = 'ICON'.
    is_fieldcat-col_pos     = '1'.
    is_fieldcat-outputlen   = '12'.
    is_fieldcat-seltext_l   = 'ICON'.
    APPEND is_fieldcat TO it_fieldcat.
    CLEAR is_fieldcat.
    Reward points, if helpful,
    Sandeep Kaushik
    Message was edited by:
            Sandeep Kaushik
    null

  • How can I get the output of graphical mapping as an input to java mapping?

    Hi Experts,
    I am using graphical mapping in my scenario to get an xml at the end, now after this i want to use java mapping and then do encryption on this input. I am using both the mappings in the same interface
    Here the thing is, the input to the java mapping should be the output of the first graphical mapping.
    How can I link the java mapping and graphical mapping so that Ill get the output of the graphical mapping as the input to the java mapping?
    Some pointers to similar kind of implementations is highly appreciated.
    Thanks in advance,
    Thomas
    Edited by: Thomas Varghese on Jan 22, 2009 11:35 AM

    hi,
    the input to the jave mapping will be exaclty the same as if you don't have
    any mapping before that
    the only different is that the input will be XML of the output of the message mapping
    have a look at my blog to see how to combine two mappings:
    /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    that's all
    Regards,
    Michal Krawczyk

  • How can i retrieve the output of procedure using a select statement ?

    Hi every one.
    this mite be dumm ?
    how can i use the output of the a procedure containing multiple rows of data in a select statement ?

    This is not  a SQL Developer question. You should ask it in the SQL and PL/SQL forum.
    The short answer is you can't.  Sounds is if you are trying to use MSSQL techniques in oracle. Learn oracle techniques

  • When bates numbering a .pdf in XI, how can I change the file name to include the bates number AND its name?  I know under file output, there is an option for either/or.  I want both.  Thank you.

    when bates numbering a .pdf in XI, how can I change the file name to include the bates number and the file name?  I know under "file output: it's either/or.  I need both.  Thanks!

    Long ago I wrote a little demo using the touch command. Check out the following thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=25128#M25128
    LabVIEW Champion . Do more with less code and in less time .

  • How can I get the name of a output module template

    Hey guys,
         SDK newbie here.
         How can I get the name of every output module template?
         Thanks
    Zhiqiang Li

    Ok. Bravo
    Please mark this as 'Answered' - it will help others on the forum -

  • How can i save the values of output waveform in array ?

    hi
    how can i save the values of  output waveform in array ?

     how can i save the values of  output waveform in array ?
    the program is attachment bellow
    Attachments:
    closed loop transfer fn+fuzzy.vi ‏28 KB

  • How can i see the output of a form

    I am having one driver program and form.From these two how can i see the output.

    Hi Sunny
    You might already know; but for the driver program; a smartform is just a function module.
    (In the smartform; this function module name can be found in the menu tab Environment -> Function Module Name.)
    Note: The FM 'SSF_FUNCTION_MODULE_NAME' is obviously the correct way of getting the FM name from the smartform name !!
    So all you need to do is call this function module passing any variable / tables you need to pass to the smartform from your driver program.
    Hope it helps
    Neer

Maybe you are looking for