Cfif to select which query to use.

I need some help getting syntax on an issue.  I have a listbox with 3 values, True(1), False(0) and Needs Approval(NULL) but I can't seem to get the NULL to show. The SQL column has this as a bit value so a Case adjustment does not work.
What I need this to do is if the Needs Approval value is selected in the cboApproved box then use the 'qRecordsNull" query to get the results, else use the "qRecords" query.
Below is the code that I have that works for true and false.  Any help would be greatly appreciated.
<cfset vApproved = 0>
<cfif isDefined("form.cboApproved")>
<cfif form.cboApproved eq "">
  <cfset vApproved = 0>
<cfelse>
  <cfset vApproved = #form.cboApproved#>
</cfif>
<cfelse>
<cfset vApproved = 0>
</cfif> [/code]
<td>
       <select name="cboApproved" class="smallFont">
        <!---<option value="All">All</option>--->
                 <option value="1"
         <cfif isDefined("vApproved")>
          <cfif vApproved eq 1>
            selected
          </cfif>
         </cfif>
        >True</option>
                 <option value="0"
         <cfif isDefined("vApproved")>
          <cfif vApproved eq 0>
            selected
          </cfif>
         </cfif>
        >False</option>
                 <option value= "">Need Approval</option>
       </select>
      </td>
Basically something that looks like this:
<cfif isDefined("form.cboApproved")>
<cfif #form.cboApproved# eq "Needs Approval">
  <cfquery name="qRecordsNull"
<cfelse>
  <cfquery name="qRecords"
</cfif>

1. Replace the following code:
<cfset vApproved = 0>
<cfif isDefined("form.cboApproved")>
<cfif form.cboApproved eq "">
  <cfset vApproved = 0>
<cfelse>
  <cfset vApproved = #form.cboApproved#>
</cfif>
<cfelse>
<cfset vApproved = 0>
</cfif>
with this one:
<cfset vApproved = 0>
<cfif isDefined("form.cboApproved") and form.cboApproved neq "">
  <cfset vApproved = #form.cboApproved#>
</cfif>
2. Replace the following code:
<cfif isDefined("form.cboApproved")>
<cfif #form.cboApproved# eq "Needs Approval">
  <cfquery name="qRecordsNull"
<cfelse>
  <cfquery name="qRecords"
</cfif>
</cfif>
with this one:
<cfif isDefined("form.cboApproved") and form.cboApproved eq "Needs Approval">
    <cfquery name="qRecordsNull" datasource="myDSN">
    <!--- query --->
    </cfquery>
<cfelse>
      <cfquery name="qRecordsNull" datasource="myDSN">
    <!--- query --->
        </cfquery>
</cfif>

Similar Messages

  • Which query is using which Hierarchy?

    Hello All,
    Where can i get the information like which query is using which hierarchy!?
    I tried to make it happen by combining lot of tables like
    RSRREPDIR
    RSZELTPROP
    RSZELTXREF
    RSHIEDIR
    RSZCOMPDIR
    but couldn't arrive at a solution. Did u guys come across such a situation!?
    If so please brief me how?
    Thanks
    Karthik

    Please see this link for a solution:
    Queries that use a hierarchy
    Hope this helps.
    Regards
    PS: assign points is the way to say thanks

  • Selecting which disk to use in Time Machine

    Mavericks allows the use of multiple backup disks in Time Machine. Is there any way to select which disk to use when browsing a backup?

    Yes while clicking on the TM icon in the Status bar press the option key.
    The Enter Time Machine menu entry will change to Browse Other Backup Disks. You can then elect the disk to browse.

  • Need to know which query to use  in BI 7.0 BI Statistics

    Hi
    I want to develop a query that gives like user id, query name and how many times executed in a given period. We are using BI 7 stats content. I like to know what chars and key figures to be used on my query. My selection criteria is given a query name and period, retrieve userd ids and how many times executed.
    Is there any std query which I can use in BI version 7.
    Note :  I am NOT  interested in BW3.5 since have installed 7.0 version.
    Any help in this regard is a great help.

    i am not sure if some standard query is available
    but u can desing ur query quickly
    try to use the multiproviders 0TCT_MC01 &  0TCT_MC02
    0TCT_MC01-- FRONT END OLAP STAT AGGREGATED
    0TCT_MC02-- FRONT END OLAP STAT DETAILED.
    0TCT_MC02  has the detailed steps
    use USERNM , BI APPLICATION OBJECT & BI APPLICATION in rows  and then use COUNTER, COUNT OF BI APPLICATION & COUNT OF BI APPLICATION OBJECT in Columns.
    Design this query.
    try to use calday, and Timestamp in Free chars...
    try to run the query from both multiprovider and try to verify ur result.
    from my xperience if u use  0TCT_MC02 it will give u detail steps so try to use this....
    u can use standard queries, but as u r familiar with ur requirement the best approach is to design ur own query asu have to then spend time understanding the standard queries and change them.
    but the data that u need with respect to user id, query ran, etc is available in  0TCT_MC01 &  0TCT_MC02

  • Is there a way to select which display to use??

    Hi,
    I think my problem is OS dependent but i'm still gonna ask...
    Code related to this problem is:
      Process runner;
      Runtime t = Runtime.getRuntime();
      runner = t.exec("<path-to-office>\powerpnt.exe /s '<path-to-show>\show.ppt'");
      //  The program in line above is not nessecary  powerpoint it can be also Acrobat or web browser!!
      // (basicly  anythig which can be run on full-screen mode from command line)
    The Problemo:
    I have a computer (running on Win XP) which has two (or more) displays attached (Matrox G550),
    do i have a chance to detect amount of displays and if there is more than one display, can i somehow
    select in Runtime which display to use to show results of code above?
    Matrox solution was "when you run program once in certain display , it should be opened in same
    display next time", well... what if i shoud use 2 powerpoints in same time to have x kind of ppt in one
    screen and y kind in second screen wich has totally different kind of info what screen x does?
    If it's possible with JFrame to decide wich screen to use, i'm almost shure that i can change program to
    use pictures instead of external programs.
    -jori

    Hmm, I don't know how you would do this with out going native, but for Java frames you can use the following links.
    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GraphicsDevice.html
    http://openide.netbeans.org/multi-monitors.html

  • Why is the "From:" field being changed in Mac Mail.  I have multiple gmail accounts setup and it seems to change the "FROM" field even though I've selected which account to use to send the email.

    So
    I've got multiple gmail accounts setup in Mac Mail.
    Somtimes when I send or forward emails, it uses the wrong FROM field even though I'm declaring
    specifically which account to use.
    This becomes apparent when the person replies to my message and it goes to the wrong account

    Check you accounts in Mail and make sure each account has the correct outgoing server address. Check the box to use only that server.
    Second, go to the gmail website and in settings under the account tab, make sure you have the correct settings for replying to messages.

  • "select into" query statements using the DI API

    I am trying to use the DI API (6.5) t create a temp table based on an existing table.  For example, here is a query string....
    select * into ORDR_TEMP from ORDR
    Code...
    oRecordSet := IRecordset(oCompany.GetBusinessObject(BoRecordset));
    oRecordset.DoQuery(sSql);
    Error I get...
    1). [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot use SELECT INTO in browse mode. 2). [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared
    For any other regular select statements the previous code works.  Does anyone know for sure if a "select into" statement is not possible using the DI API?

    Hi Bill,
    I´m not really sure if select into is avaiable. But here you´ve got a hint: You could use a user defined function to do it, and just call the function from your code.
    SELECT dbo.MyFunction()
    Having this function defined in your SQL Server:
    CREATE function MyFunction ()
    returns char(2)
    AS
    Begin
    select * into ORDR_TEMP from ORDR
    Return ('OK')
    End
    Hope this helps,
    Ibai Peñ

  • How to find which Query is using program AQ10MM==========Z6============

    Hi,
    I wanted to know how to find out which SAP query uses this program. AQ10MM==========Z6============
    I tried with SQ01/02 but was unable to get it. Can you please help.
    Regards,
    Mukund S

    In my installation , it is usually AQZZ"usergroup"========QUERYNAME======
    You could see if you have a user group 'MM' or '10MM' in SQ03 and set the user group if available.. then in SQ01, see if you have a query called Z6
    Also try out this function module RSAQ_DECODE_REPORT_NAME to see if it would give you the user group and query name...

  • Is it possible to select which div is used in fluid design?

    OK, I have built a site that consists of header and footer sections and three column divs - LeftDataBox, CenterDataBox and RightDataBox. I've used Dreamweaver CS6 to design it in a fluid style and it works well going from desktop to cell phone. However, when the site moves to the cell phone, the column LeftDataBox appears first after the header. Since most of the active content of the site is placed in the CenterDataBox div, I would prefer if that was the first div selected instead of LeftDataBox. Is there something in DW or CSS that I can apply to tell the browser to pick the CenterDataBox first? I haven't bothered to include code here, as it will not be particularly useful in the more or less general question I'm asking. I can send a link to the site if that might help, but I think it's pretty straightforward - by default as the divs lay out on the smaller screen, they go from top to bottom/left to right. I would like to swap the divs containing LeftDataBox and CenterDataBox for only small screens. If the question seems inappropriate I apologize, but have not been able to find a realistic answer after searching the web.

    I prefer to use HTML5 tags.  Aside = sidebars. Article = main content.
    What I'm saying is  FGLayouts are not able to switch div order.  Div order is based on where you put it in the HTML markup.
    However, with CSS Flexbox  div order can be defined in your media queries like this.
    Mobile:
      header    { order: 1; }
      nav       { order: 2; }
      article  { order: 3; }
      aside.one { order: 4; }
      aside.two { order: 5; }
      footer    { order: 6; }
    Desktop:
      header    { order: 1; }
      nav       { order: 2; }
      aside.one { order: 3; }
      article   { order: 4; }
      aside.two { order: 5; }
      footer    { order: 6; }
    But Flexbox is not quite ready for prime time yet.  Browser support for it is still spotty. You can read more about it at CSS Tricks:  https://css-tricks.com/snippets/css/a-guide-to-flexbox/
    Nancy O.

  • How can I select which photo is used on the cover of an i-Photo book?

    I have created a photobook, and can do most things I need, but the photo selected by Autoflow for the cover is not the one I want. Can anyone tell me how to change it?

    You can drag any of your photos to the coverpage.
    Click onto the title page to select it and open the Photos Browser window, then drag the photo you want to use onto the title page.

  • How to get which query is using by reports using OEM

    Hi,
    can any one help me how to get the queries whcih are used by reports by clent by using OEM. Its same like using profiler in sql server
    Thanks in advance
    Edited by: user8884944 on Nov 6, 2010 2:18 AM

    In my installation , it is usually AQZZ"usergroup"========QUERYNAME======
    You could see if you have a user group 'MM' or '10MM' in SQ03 and set the user group if available.. then in SQ01, see if you have a query called Z6
    Also try out this function module RSAQ_DECODE_REPORT_NAME to see if it would give you the user group and query name...

  • Date Data Selection in Query Builder using Hyperion JDBC Driver

    Hi,
    I am trying to filter out data prior to a specific request date on Query Builder. I have tried :
    and SALES_ORDER_FACT.REQ_DT < sysdate()
    I have also tried {$SYSDATE()-1$} , {$SYSDATE()$}, SYSDATE and SYSDATE()
    Any assistance will be appreciated.

    Is this related to Oracle BI Publisher?
    You should be able just to edit the query correctly in the text - you ddon't need to use the SQL query builder.
    The query is passed through so in general you should use the syntax of HJyperion.
    {} has a special (I think undocumented) meaning in BI Publisher so {} could potnetially cause problems.
    Klaus

  • Let me select which file to use

    Hi,
    I'm making a video converting automator script. I have everything figured out except for telling automator to let me choose which file I want to convert. How do I do this?
    Thanks!

    I don't have that application - are you using a Watch Me Do action to try and script the application? Following the Ask for FInder Items action with a Open Finder Items action will open the chosen files in the specified application.

  • Needs  help to retrive the last row in a  select query without using rownum

    Hi ,
    i need to retrive the last row from the select sub query without using rownum.
    is there any other way to retrive the last row other than the below query.
    is that the ROWNUM=1 will always retrive the 1 row of the select query ?
    select from*
    *(select ename from employee where dept_id=5 order by desc) where rownum=1;*
    Please advise.
    thanks for your help advance,
    regards,
    Senthur

    957595 wrote:
    Actually my problem is ithat while selecting the parents hiearchy of the child data using
    CONNECT BY PRIOIR query
    I need the immediate parent of my child data.
    For example my connect BY query returns
    AAA --- ROOT
    BBB --PARENT -2
    CCC --PARENT-1
    DDD IS my input child to the connect by query
    Immediate parent of my child data "DDD" ---> CCC(parent -1)
    i want the data "CCC" from the select query,for that i am taking the last row of the query with rownum.
    I got to hear that using ROWNUM to retrive the data will leads to some problem.It is a like a magic number.I am not sure what the problem will be.
    So confusing with using this rownum in my query.
    Please advice!!!It's not quite clear what you're wanting, but perhaps this may help?
    you can select the PRIOR values to get the parent details if you want...
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, lpad(' ',(level-1)*2,' ')||ename as ename, prior empno as mgr
      2  from emp
      3  connect by mgr = prior empno
      4* start with mgr is null
    SQL> /
         EMPNO ENAME                                 MGR
          7839 KING
          7566   JONES                              7839
          7788     SCOTT                            7566
          7876       ADAMS                          7788
          7902     FORD                             7566
          7369       SMITH                          7902
          7698   BLAKE                              7839
          7499     ALLEN                            7698
          7521     WARD                             7698
          7654     MARTIN                           7698
          7844     TURNER                           7698
          7900     JAMES                            7698
          7782   CLARK                              7839
          7934     MILLER                           7782
    14 rows selected.(ok, not the best of examples as the mgr is already known for a row, but it demonstrates you can select prior data)

  • How to know whether a particular query is using the aggregates

    hi all....
    im very new to this group so plz help me out.....anyway hi to all ....
    There are many aggreegates are there but how to know which query is using perticular a?gregates

    Hi,
    use query monitor screen RSRT and select the option execute + debug . and u can have the option of checking display aggreagates for that query!
    cheers,
    ravi

Maybe you are looking for

  • Error while linking user defined table to user defined field using vb6.0

    Hi, I am creating a userdefined field on a SAPB1 table(PDN1) using vb 6.0 I am trying to link this field to a user defined table. When i do that i get the following error: "The field 'Related table' should consist of 8 alphanumeric chracters with no

  • Attachments sent to customer service are not received.

    CRM Experts , We have a typical issue . The business processes is as mentioned below. There are some customers who send their requests via e-mail with attached files to the client but the customer service agents in the Interaction Center are complain

  • Can't change export settings

    Hi again, just fixed crash problem in Blue-Ray loading timeline (thanks Ann), I've another problem. I cannot change export setting. The window let me choose my best solution (example: PAL, 1440x1080, 25fps, high quality.........), click OK, but, if I

  • UPSA Errors, SQL Errors, Timeouts, Event ID 3, Event ID 3355

    Greetings, My User Profile Service has been running without issue for the last week or so; once I was able to provision it. Yesterday morning, we noticed it was in a "User Profile Sync is not currently provisioned" state. I went through the normal st

  • Missing classes in OBE series

    I am new to JDeveloper and am doing the 'Building a Web Application with ADF and Oracle TopLink' tutorial. Towards the end when I am ready to test my app, I get all kinds of errors of classes not found kind. The backing classes are missing UIComponen