Help with ORBER BY in my query when negative numbers are involved

hi,
I have
SELECT *
FROM my_table
WHERE age = 5
ORDER BY photoSmall DESC
my_table looks like this:
key | age | photoSmall
1 25 2
2 25 3
3 25 1
4 25 -1
now, i would expect my results to be ordered as follows:
firstly record 2 (because it has the highest "photoSmall"
value of 3
then record 1 (it has the next highest "photoSmall" value of
2)
then record 3 ("photoSmall" being 1)
finally record 4 ("photoSmall" of -1 being the lowest value
of all..
but no!
it seems CF is treating -1 and 1 as being the same, how odd
do i need to amend my query to:
SELECT *
FROM my_table
WHERE age = 5
ORDER BY photoSmall DESC
CFpositive_numbers_are_greater_than_negative_numbers=YES ??
any help would be greatly appreciated - thanks very much
indeed.

Thank you both very much for your help. I tried Pauls fix but
alas my access db
didn't like the "cast(photoSmall as int" concept (or at least
i couldnt get it
to work)
so in the end i did what i should have done in the first
place and changed the
photosmall var to a numeric rather than a text one.
i was forgetting that whilst CF doesnt seem to care what
"type" of variable
you give it it just gets on and "does the maths", of course
it is access that
is ordering my results
so thanks very much - this one is now fixed - cheers

Similar Messages

  • Newbie: help with join in a select query

    Hi: I need some help with creating a select statement.
    I have two tables t1 (fields: id, time, cost, t2id) and t2 (fields: id, time, cost). t2id from t1 is the primary key in t2. I want a single select statement to list all time and cost from both t1 and t2. I think I need to use join but can't seem to figure it out even after going through some tutorials.
    Thanks in advance.
    Ray

    t1 has following records
    pkid, time, cost,product
    1,123456,34,801
    2,123457,20,802
    3,345678,40,801
    t2 has the following records
    id,productid,time,cost
    1,801,4356789,12
    2,801,4356790,1
    3,802,9845679,100
    4,801,9345614,12
    I want a query that will print following from t1 (time and cost for records that have product=801)
    123456,34
    345678,40
    followed by following from t2 (time and cost for records that have productid=801)
    4356789,12
    4356790,1
    9345614,12
    Is this possible?
    Thanks
    ray

  • Is anyone having problems with the iOS 6 update? Random, unknown people are involved in my text messages!

    Is anyone having a problem with iOS 6 update? Random, unknown people are involved in my text messages!

    I noticed that after I linked Facebook to my iphone, I had tons of new entries in my Contacts. I found a way to turn that feature off. Perhaps that's your problem with randoms joining in on your convos.
    Yep, follow the instructions listed by the guy above me. I also did this: Settings ---> Facebook ---> Contacts: Off (allow these apps to use ur account). That cleared out all my Facebook friend phone numbers from my Contact list on my phone. Hope this helps. Updating an os should not require oodles of work on our end.

  • Help with over by clause in query.

    guys i have a table like this
    create table fgbtrnh ( fgbtrnh_doc_code varchar2(9),
                                             fgbtrnh_trans_date date,
                                             fgbtrnh_trans_amt number(17,2),
                                             fgbtrnh_acct varchar2(6) ,
                                             fgbtrnh_fund_code varchar2(6),
                                             fgbtrnh_rucl_code varchar2(6) );
    with data like this.
       insert into fgbtrnh( fgbtrnh_doc_code,fgbtrnh_trans_date,fgbtrnh_trans_amt,fgbtrnh_acct,fgbtrnh_rucl_code,fgbtrnh_fund_code) values('J0005445','31-MAY-10','38491','6001','BD01','360098');
    insert into fgbtrnh( fgbtrnh_doc_code,fgbtrnh_trans_date,fgbtrnh_trans_amt,fgbtrnh_acct,fgbtrnh_rucl_code,fgbtrnh_fund_code) values('L0000005','01-JUL-08','38260','6001','BD01','360098');
    insert into fgbtrnh( fgbtrnh_doc_code,fgbtrnh_trans_date,fgbtrnh_trans_amt,fgbtrnh_acct,fgbtrnh_rucl_code,fgbtrnh_fund_code) values('L0000002','30-JUN-08','24425.29','6001','BD01','360125');
    insert into fgbtrnh( fgbtrnh_doc_code,fgbtrnh_trans_date,fgbtrnh_trans_amt,fgbtrnh_acct,fgbtrnh_rucl_code,fgbtrnh_fund_code) values('L0000002','30-JUN-08','48057.71','6001','BD01','360125');
    insert into fgbtrnh( fgbtrnh_doc_code,fgbtrnh_trans_date,fgbtrnh_trans_amt,fgbtrnh_acct,fgbtrnh_rucl_code,fgbtrnh_fund_code) values('M0000002','30-JUN-08','90','7200','BD01','360098');i would like to get a running total of these items so i tried something like this.
    select  f.fgbtrnh_doc_code,f.fgbtrnh_trans_date,f.fgbtrnh_trans_amt, sum(f.fgbtrnh_trans_amt)
    over
    (--partition by  f.fgbtrnh_doc_code
    order by fgbtrnh_trans_date desc  ROWS UNBOUNDED PRECEDING
    --group by  f.fgbtrnh_doc_code
    )total
    From fgbtrnh f
    where f.fgbtrnh_fund_code in ('360098', '360125')
    and f.fgbtrnh_rucl_code = 'BD01'
    and f.fgbtrnh_acct = '6001'
    order by  f.fgbtrnh_trans_date desc,  f.fgbtrnh_doc_codebut i end up with a result set like
    "FGBTRNH_DOC_CODE", "FGBTRNH_TRANS_DATE", "FGBTRNH_TRANS_AMT", "TOTAL"
    "J0005445", 31-MAY-10, 38491, 38491
    "L0000005", 01-JUL-08, 38260, 76751
    "L0000002", 30-JUN-08, 24425.29, 101176.29
    "L0000002", 30-JUN-08, 48057.71, 149234
    i would like to thave the running total to start from the bottom in other word is my total column i would like to end up with the 149234 at the top
    so it would look something like so.
    "FGBTRNH_DOC_CODE", "FGBTRNH_TRANS_DATE", "FGBTRNH_TRANS_AMT", "TOTAL"
    "J0005445", 31-MAY-10, 38491, 149234
    "L0000005", 01-JUL-08, 38260, 110743
    "L0000002", 30-JUN-08, 24425.29, 72483
    "L0000002", 30-JUN-08, 48057.71, 48057.71
    i have tried everything and just cant seem to make this work can someone please point me in the rigth direction.
    I would really appreciate the help.
    Thanks
    Miguel

    Hi, Miguel,
    mlov83 wrote:
    ... Also, if you uniquely order the rows, you won't need the windowing clause ("ROWS UNBOUNDED PRECEEDING"); the default ("RANGE UNBOUNDED PRECEDING") will produce exactly what you want, so you don;'t need to say it.
    I dont really understand what you mean by this ? but if i take a gander are you saying that all my rows would have to be unique and then i wont have to use ("ROWS UNBOUNDED PRECEEDING")I think you got it right.
    The analytic ORDER BY clause doesn't have to result in a unique ordering; there are good reasons for having a unique oprdering, and there are good reasons for not having a unique ordering.
    I'm saying that if the analytic ORDER BY is unique, then you don't need to give a widnowing clause, such as "ROWS UNBOUNDED PRECEEDING".
    Frank sorry if im asking some really stupid questions but i have tried and tried to read and understand "partion by" and "over" work but im not quite sure I understand yet. It's not stupid at all! Analytic functions can be very subtle and confusing.
    Let's use a query based on the scott.emp table, which has seveal rows for each deptno.
    -- Tell SQL*Plus to put a blank line between deptnos, just to make the output easier to read
    BREAK     ON deptno   SKIP 1     DUPLICATES
    SELECT       deptno
    ,       ename
    ,       sal
    ,       SUM (sal) OVER ( PARTITION BY  deptno
                                ORDER BY        sal
                      ROWS            UNBOUNDED PRECEDING
                    )     AS running_total
    FROM       scott.emp
    ORDER BY  deptno
    ,            sal          DESC
    ,       ename
    ;Output:
    `   DEPTNO ENAME             SAL RUNNING_TOTAL
            10 KING             5000          8750
            10 CLARK            2450          3750
            10 MILLER           1300          1300
            20 FORD             3000         10875
            20 SCOTT            3000          7875
            20 JONES            2975          4875
            20 ADAMS            1100          1900
            20 SMITH             800           800
            30 BLAKE            2850          9400
            30 ALLEN            1600          6550
            30 TURNER           1500          4950
            30 MARTIN           1250          2200
            30 WARD             1250          3450
            30 JAMES             950           950PARTITION BY deptno" means do a separate calculation for each distinct value of deptno. Rows with deptno=10 don't effect the results on rows where deptno=20 or deptno=30. Since there are 3 distinct values of deptno, there are 3 distinct running totals.
    Notice that the aNalytic ORDER BY clause results only in a partial ordering. If there are two or more rows in the same deptno that happen to have the same sal, look what can happen:
    {code}
    ` DEPTNO ENAME SAL RUNNING_TOTAL
    ... 30 TURNER 1500 4950
    30 MARTIN 1250 2200
    30 WARD 1250 3450
    30 JAMES 950 950
    {code}
    MARTIN and WARD are in the same partition (deptno=30), and they both have the same sal (1250), so there is no reason why one of those rows would be considered "before" the other one. When you use a windowing clause based on ROWS, as above, and there is a tie for whcih row comes first (as there is a tie between MARTIN and WARD), then one of the rows will arbitrarily be condidered to be before the other one. In this example, it happened to chose MARTIN as the 2nd lowest sal, so running_total=2200 (= 950 + 1250) on the row for MARTIN, and running_total=3450 ( = 950 + 1250 + 1250) on the row for WARD. There's no particular reason for that; it's completely arbitrary. I might do the exact same query tomorrow, or in 10 minutes, and get running_total=2200 on WARD's row, and 3450 on MARTIN's.
    However, it is no accident that MARTIN comes before WARD in the output; the *query* ORDER BY clause (which has nothing to do with the analytic ORDER BY clause) guarantees that, when two rows have the same deptno and sal, then the one with the earlier ename will come first.
    Now, what's the difference between a window based on ROWS and a window bnased on RANGE?
    One difference is that, when a tie occurs in the ORDER BY clause, all rows with the same value of sal get the same value for SUM (sal):
    {code}
    SELECT     deptno
    ,     ename
    ,     sal
    ,     SUM (sal) OVER ( PARTITION BY deptno
                   ORDER BY      sal
                   )     AS running_total
    FROM     scott.emp
    ORDER BY deptno
    ,      sal          DESC
    ,     ename
    {code}
    Notice that the only difference between the first query above and this one is that this one does not have an analytic windowing clause, so the default window, *RANGE* UNBOUNDED PRECEDING is used.
    Output:
    {code}
    ` DEPTNO ENAME SAL RUNNING_TOTAL
    10 KING 5000 8750
    10 CLARK 2450 3750
    10 MILLER 1300 1300
    20 FORD 3000 10875
    20 SCOTT 3000 10875
    20 JONES 2975 4875
    20 ADAMS 1100 1900
    20 SMITH 800 800
    30 BLAKE 2850 9400
    30 ALLEN 1600 6550
    30 TURNER 1500 4950
    30 MARTIN 1250 3450
    30 WARD 1250 3450
    30 JAMES 950 950
    {code}
    Again, look at MARTIN and WARD near the end. They both have the ame sal, so they both have the same running_total=3450 (= 950 + 1250 + 1250). This is often a desireable result, but, in your case, it seems not to be. If you want separate running_totals for MARTIN and WARD, then you eigher have to use a ROW-based window, like we did earlier, or add a tie-breaker to the ORDER BY clause, like this:
    {code}
    SELECT     deptno
    ,     ename
    ,     sal
    ,     SUM (sal) OVER ( PARTITION BY deptno
                   ORDER BY      sal
                   ,          ename          DESC     -- Changed (this is the only change)
                   )     AS running_total
    FROM     scott.emp
    ORDER BY deptno
    ,      sal          DESC
    ,     ename
    {code}
    Output:
    {code}
    ` DEPTNO ENAME SAL RUNNING_TOTAL
    10 KING 5000 8750
    10 CLARK 2450 3750
    10 MILLER 1300 1300
    20 FORD 3000 10875
    20 SCOTT 3000 7875
    20 JONES 2975 4875
    20 ADAMS 1100 1900
    20 SMITH 800 800
    30 BLAKE 2850 9400
    30 ALLEN 1600 6550
    30 TURNER 1500 4950
    30 MARTIN 1250 3450
    30 WARD 1250 2200
    30 JAMES 950 950
    {code}

  • Help with JTable - content of cell disappears when selected

    Hello,
    I have a jTable and I have created a custom cell renderer. It does what it's supposed to do (which is set the background color of all cells with null or "" value to red - as an indication to the user that b4 proceeding he/she has to fill in this cells). The problem is that when I select a red cell, it becomes white and the text value it contains disappears. When I double click I can start typing in a new value.
    I would appreciate any hint why this happens? Ideally I would like the cell to keep its color when clicked or double-clicked and its value, and only when i'm done editing its content and it's not null or empty string to become white.
    I'm including majority of my code (some automatically generated code from Netbeans is not included).
    Thank you very much,
    Laura
    public class DataNormalisation extends javax.swing.JFrame {   
        JTextArea txt=new JTextArea();
        public Object[][] DataSummary;
        public Vector<String> colName;
        MainF p;
        String[] ExpNames;
        /** Creates new form DataNormalisation */
        public DataNormalisation(String[] EN, MainF parent) {
            p=parent;
            ExpNames=EN;
            colName= new Vector<String>();
            colName.add("Sample Name");
            colName.add("Replicate Group");
            DataSummary=new Object[ExpNames.length][2];
            for (int i=0;i<ExpNames.length;i++){
                DataSummary[0]=ExpNames[i];
    initComponents();
    this.jTable1.getTableHeader().setReorderingAllowed(false);
    TableColumn column = jTable1.getColumnModel().getColumn(1);
    column.setCellRenderer(new CustomTableCellRenderer());
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new JTable (new DataModel());
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Data Normalisation");
    jTable1.setAutoCreateRowSorter(true);
    jTable1.setCellSelectionEnabled(true);
    jScrollPane1.setViewportView(jTable1);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration
    class DataModel extends AbstractTableModel {       
    class TML implements TableModelListener{
    public void tableChanged (TableModelEvent e){
    txt.setText(""); // Clear it
    for (int i=0;i<DataSummary.length; i++){
    for (int j=0; j<DataSummary[0].length;j++){
    txt.append(DataSummary[i][j] + " ");
    txt.append("\n");
    public DataModel(){
    addTableModelListener(new TML());
    @Override
    public void setValueAt(Object val, int row, int col){
    DataSummary[row][col]=val;
    fireTableDataChanged();
    @Override
    public boolean isCellEditable(int row, int col){
    return (col != 0);
    public int getRowCount(){
    return DataSummary.length;
    public int getColumnCount(){
    return colName.size();
    public Object getValueAt(int row, int column){   
    return DataSummary[row][column];
    public String getColumnName(int col) {           
    return colName.get(col);
    class CustomTableCellRenderer extends DefaultTableCellRenderer {       
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column) {
    Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    if (value == null || value.equals("")) {
    cell.setBackground(Color.red);
    } else cell.setBackground(Color.white);
    return cell;

    Ideally I would like the cell to keep its color when clicked or double-clicked Not sure why is changes color when you click on the cell.
    But when you double click the editor is invoked, which is a JTextField and its background is white by default.
    The code you posted doesn't help because its not executable.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    And don't post NetBeans generated code, because we don't use IDE to write GUI code.
    Also, why did you create a custom TableModel. The DefaultTableModel will store your data for you.

  • Need Help with instr/Regexp for the query

    Hi Oracle Folks
    I am using Oracle
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    I have some student responses and the valid values are +/-/O(alphabet)/P and spaces at the end of the sting only not in the middle.
    As per my requirement the record number 2 3,4 should be listed from the query but I am getting only one (record 3).
    Can we use REG_EXP
    Please help.
    Thanks in advance.
    Rajesh
    with x as (
    SELECT '+-+-POPPPPPP   ' STUDENT_RESPONSE, 1 record_number FROM DUAL union all
    SELECT '+--AOPPPPPP++' STUDENT_RESPONSE, 2 record_number FROM DUAL union all
    SELECT '+-+-  OPPPPPP--' STUDENT_RESPONSE, 3 record_number FROM DUAL union all
    SELECT '+-+-9OPPPPPP   ' STUDENT_RESPONSE, 4 record_number FROM DUAL )
    (SELECT RECORD_NUMBER,
    TRIM(STUDENT_RESPONSE) FROM X
    WHERE
    ((INSTR (UPPER(TRIM(STUDENT_RESPONSE)),'-') =0)
    OR (INSTR (UPPER(TRIM(STUDENT_RESPONSE)),'+') =0)
    OR (INSTR (UPPER(TRIM(STUDENT_RESPONSE)),'O') =0)
    OR (INSTR (UPPER(TRIM(STUDENT_RESPONSE)),'P') =0)
    OR (INSTR (UPPER(TRIM(STUDENT_RESPONSE)),' ') !=0)
    )

    Hi, Rajesh,
    Rb2000rb65 wrote:
    Hi Oracle Folks
    I am using Oracle
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsThanks for posting this (and the WITH clause for the sample data). That's very helpful.
    I have some student responses and the valid values are +/-/O(alphabet)/P and spaces at the end of the sting only not in the middle.Are you combining the responses to several qeustions in one VARCHAR2 column? It might be better to have a separate row for each question.
    As per my requirement the record number 2 3,4 should be listed from the query but I am getting only one (record 3). What exactly is your requirement? Are you trying to find the rows where student_response contains any of the forbidden characters, or where it contains a space anywhere but at the end of the string?
    Can we use REG_EXPYes, but it's easy enough, and probably more efficient, to not use regular expressions in this case:
    Here's one way:
    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     TRANSLATE ( UPPER ( RTRIM (student_response, ' '))
                , 'X+-OP'
                , 'X'
                )     IS NOT NULL
    ;That is, once you remove trailing spaces and all occurrences of '+', '-', 'O' or 'P', then only the forbidden characters are left, and you want to select the row if there are any of those.
    If you really, really want to use a regular expression:
    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     REGEXP_LIKE ( RTRIM (student_response)
                  , '[^-+OP]'          -- or '[^+OP-]', but not '[^+-OP]'.  Discuss amongst yourselves
                  , 'i'
    ;but, I repeat, this will probably be slower than the first solution, using TRANSLATE.
    Edited by: Frank Kulash on Oct 17, 2011 1:05 PM
    Edited by: Frank Kulash on Oct 17, 2011 1:41 PM
    The following is slightly simpler than TRANSLATE:
    SELECT     record_number
    ,     student_response
    FROM     x
    WHERE     RTRIM ( UPPER ( RTRIM (student_response, ' '))
               , '+-OP'
               )          IS NOT NULL
    ;

  • Help with PS script that gets run when an event ID is triggered.

    Hello,
    I've had some great help from Mike Laughlin on this forum on creating a simple PS script that can email me when a particular event id is seen on a server.
    Here it is:
    $serverName = $env:COMPUTERNAME
    Send-MailMessage -to [email protected] -Subject "$serverName - Low on Virtual Memory" -body "$serverName
    - low on virtual memory" -smtpserver smtp.gb.local -from [email protected]
    What I want to add is the event id to in the email too so we can get more information, is this possible?

    Here are some suggestions:
    Here is a defined trigger for security event ID 5156.  It is good for learning because it happens frequently.
    <Triggers>
    <EventTrigger>
    <Enabled>true</Enabled>
    <Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Security"&gt;&lt;Select Path="Security"&gt;*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=5156]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
    <ValueQueries>
    <Value name="Application">Event/EventData/Data[@Name='Application']</Value>
    <Value name="DestAddress">Event/EventData/Data[@Name='DestAddress']</Value>
    <Value name="DestPort">Event/EventData/Data[@Name='DestPort']</Value>
    <Value name="SourceAddress">Event/EventData/Data[@Name='SourceAddress']</Value>
    <Value name="SourcePort">Event/EventData/Data[@Name='SourcePort']</Value>
    <Value name="TimeCreated">Event/System/TimeCreated/@SystemTime</Value>
    </ValueQueries>
    </EventTrigger>
    </Triggers>
    The ValueQuery defines the path to the values in the event data.
    Here is how we pass the data to the command usingnamed parameters:
    <Actions Context="Author">
    <Exec>
    <Command>powershell</Command>
    <Arguments>
    -file test5156.ps1
    -Application $(Application)
    -SourceAddress $(SourceAddress)
    -SourcePort $(SourcePort)
    -DestAddress $(DestAddress)
    -DestPort $(DestPort)
    -TimeCreated $(TimeCreated)
    </Arguments>
    <WorkingDirectory>c:\test</WorkingDirectory>
    </Exec>
    </Actions>
    Notice that I do NOT use single quotes and have formatted the XML so it is easy to edit.
    The line breaks are not preserved by the XML when passed and the extra space is unimportant.
    Here is the test script that displays the passed arguments.
    Param(
    $Application,
    $SourceAddress,
    $SourcePort,
    $DestAddress,
    $DestPort,
    $TimeCreated
    '[{0:hh:mm:ss}] {1}' -f [datetime]::Now,'New Event 5156' | Out-file c:\test\testel.log -append
    $p=@{
    Application=$Application
    SourceAddress=$SourceAddress
    SourcePort=$SourcePort
    DestAddress=$DestAddress
    DestPort=$DestPort
    TimeCreated=$TimeCreated
    $parms=New-Object PsObject -Property $P
    $parms |Format-List |Out-String | Out-file c:\test\testel.log -append
    Each event ID can have very different data structures  thei si what the 5256 class o structures looks like:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" Guid="{54849625-5478-4994-A5BA-3E3B0328C30D}" />
    <EventID>5156</EventID>
    <Version>1</Version>
    <Level>0</Level>
    <Task>12810</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2015-03-18T16:51:12.152331100Z" />
    <EventRecordID>34783304</EventRecordID>
    <Correlation />
    <Execution ProcessID="4" ThreadID="3656" />
    <Channel>Security</Channel>
    <Computer>W8Test</Computer>
    <Security />
    </System>
    <EventData>
    <Data Name="ProcessID">2608</Data>
    <Data Name="Application">\device\harddiskvolume4\windows\system32\svchost.exe</Data>
    <Data Name="Direction">%%14592</Data>
    <Data Name="SourceAddress">239.255.255.250</Data>
    <Data Name="SourcePort">1900</Data>
    <Data Name="DestAddress">192.168.1.106</Data>
    <Data Name="DestPort">2232</Data>
    <Data Name="Protocol">17</Data>
    <Data Name="FilterRTID">275543</Data>
    <Data Name="LayerName">%%14610</Data>
    <Data Name="LayerRTID">44</Data>
    <Data Name="RemoteUserID">S-1-0-0</Data>
    <Data Name="RemoteMachineID">S-1-0-0</Data>
    </EventData>
    </Event>
    Note how the mappingis done from event data name and argument then to PowerSHell Parameter name.
    EVENT DATA: <Data Name="SourceAddress">239.255.255.250</Data>
    ValueQuery:   <Value name="SourceAddress">Event/EventData/Data[@Name=SourceAddress]</Value>
    TRIGGER COMMAND:
           <Arguments>
                 -file test5156.ps1
                 -SourceAddress $(SourceAddress) 
    SCRIPT PARAMS:
         Param(
             $SourceAddress,
    ¯\_(ツ)_/¯

  • Help with nvl and to_char in query

    Hi, I was wondering if anyone could help me with finding the reason that the following query gives me an invalid number error:
    SELECT     to_char('dd/mm/yyyy',nvl(co_modified_date,co_added_date)) as d1
    FROM     co_allergies_record_upd
    WHERE          co_allergies_record_upd_id IN (
    SELECT co_allergies_record_upd_id
    FROM     co_allergies_link_upd
    WHERE     co_allergies_rec_id = 42
    ORDER BY     nvl(co_modified_date,co_added_date) DESC
    Specifically, it is the nvl(co_modified_date,co_added_date) which is causing the error. The co_added_date has a NOT NULL constraint, and both are date fields. What could be causing the error?

    You have missed format and data argument places in to_char():
    SELECT to_char('dd/mm/yyyy',nvl(co_modified_date,co_added_date)) as d1
    FROM co_allergies_record_upd
    WHERE co_allergies_record_upd_id IN (
    SELECT co_allergies_record_upd_id...
    SQL> select to_char('dd/mm/yyyy',sysdate) from dual;
    select to_char('dd/mm/yyyy',sysdate) from dual
    ERROR at line 1:
    ORA-01722: invalid number
    SQL> select to_char(sysdate,'dd/mm/yyyy') from dual;
    TO_CHAR(SY
    20/12/2006Rgds.

  • Help with PL/SQL returning SQL query for Report

    Hi
    I have got a report which I have formatted as PL/SQL function body returning SQL query.
    I have the following code
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count("HELPDESK_CALL_ID) total_issues,' ||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'HELPDESK_CALL_TYPE_ID = :P9_call_type';
    end if;
    q := q || ' WHERE '|| w;
    return q;
    end;
    When I apply changes I get this error message
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00972: identifier is too long
    Any Idea where I maybe going wrong?

    thanks its compiling now but when I run the page I get this error message in the reports region
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    This is my code that I have at the momment.
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    we VARCHAR2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count(HELPDESK_CALL_ID) total_issues,' ||
    ' sum(decode(status,''Open'',1,0)) open_issues, ' ||
    ' sum(decode(status,''On-Hold'',1,0)) onhold_issues,' ||
    ' sum(decode(status,''Closed'',1,0)) closed_issues,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''High'',1,0),0)) open_high_prior,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''Medium'',1,0),0)) open_medium_prior, '||
    ' sum(decode(status,''Open'',decode
    (priority,''Low'',1,0),0)) open_low_prior '||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'where HELPDESK_CALL_TYPE_ID = :P9_call_type';
    we := 'Y';
    end if;
    if we = 'Y' then
    q := q ||w;
    end if;
    return q;
    end;
    I have a select list with a list of reports. what I am trying to do build an sql depending on what the :p9_call_type value is. -1 represents the display value of -All Reports- so if the user selects all reports it should display all results thus removing the where clause. However as my code stands when I user clicks on all reports he get the correct results for all reports. If the user selects anything else they get the error message above.

  • Need Help With ACS LDAP setup to Query AD

    I have 2 Win 2003 ADs, one of them is configured and working under Windows Database (using remote agent) configuration. I am trying to setup the second AD with Generic LDAP setup. I want to know what exactly I should use in the fields UserObjectType and Class, and GroupObjectType and Class for Windows 2003 AD. All Cisco documents give example of Netscape LDAP syntax. I was told by our server admin. what to put under Admin DN, CN=myid,OU=mygroup,OU=myorg,DC=mydomain,DC=com
    I have both user & group directory subtree fields filled with DC=mydomain,DC=com.
    I am using the ip address for Primary LDAP server, and port is 389, LDAP version 3 is checked.
    Is any of these DC, OU, etc. case sensitive?
    With all entries that I have tried, when I go to map a group, I am getting error "LDAP server NOT reachable. Please check the configuration". My ACS can ping the domain controller's IP address fine.
    Please help. Thank you in advance,
    Murali

    Murali,
    These references may help...
    http://download.microsoft.com/download/3/d/3/3d32b0cd-581c-4574-8a27-67e89c206a54/uldap.doc
    http://www.microsoft.com/technet/archive/winntas/plan/dda/ddach02.mspx?mfr=true
    http://technet.microsoft.com/en-us/library/aa996205.aspx
    Regards,
    Richard

  • Help With Movie That Continues to play when an External Link text button is clicked

    I'm using Captivate 3.
    I have a movie with Various Text Buttons one of my buttons in this particular module i'm creating when clicked opens an external PDF file for viewing.
    However, my movie in the background keeps playing when i need it to stay on that Menu Screen with the various buttons.
    Ideally so the user when done viewing the External PDF can then click another button to continue to the section in the movie where they need to go for the Software Demonstration.
    Any Ideas on how to get it to stop???   I thought i had it working yesterday but today its not.. Its possible i removed a duplicate Pause or something?
    *UPDATE - just went in to check the pause settings.. It PAUSES CORRECTLY if i Click the external Link button Once.. but if i click it again.. it reopens the link and then the demonstration starts playing in the background..
    Please help
    Christina

    Hi there
    Your post was probably overlooked because we assumed you looked at the Frequently Encountered Issues page first.
    See if the link below answers that question.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Can someone help with a div that pops up when you hover over a button?

    I made a div that pops up (stacked on the rest of the page) when you hover over a button (gigs). It works in the safari preview but when I test it online it doesn't. It's above the logo instead of blocking it and on the left site instead of the right. And when you open the page it isn't hidden like in the preview. Does someone know what is wrong?
    The test page: Stuff

    Below code, onclick of 'GIGS' shows pop-up window. You then have a 'close' button which when clicked closes it.
    <!DOCTYPE html>
    <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
    <!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
    <!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
    <!--[if gt IE 8]><!--> <html> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <title>Stuff</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="http://www.rockoco.be/stuff/css/main.css">
        <link rel="shortcut icon" href="favicon.ico">
        <link rel="apple-touch-icon" href="favicon.png">
        <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
    <script type="text/javascript">
    function MM_showHideLayers() { //v9.0
      var i,p,v,obj,args=MM_showHideLayers.arguments;
      for (i=0; i<(args.length-2); i+=3)
      with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
        if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
        obj.visibility=v; }
        </script>
    </head>
    <style>
    #popup {
        position: absolute;
        right: 0;
        z-index: 100;
    #popup img {
    display: block;
    #popup p {
    margin: 0;
    padding: 0;
    #popup a {
        text-decoration: none;
        display: inline-block;
        padding: 8px 12px;
        color: #fff;
        background-color: #000;
    </style>
    <body>
    <div id="popup">
    <img src="http://www.rockoco.be/stuff/img/Flyer-030315.png" alt="popup" width="426" height="605" class="png" />
    <p><a href="#" class="closeWindow">CLOSE</a></p>
    </div>
    <div id="content">
    <h1><img class="svg" src="http://www.rockoco.be/stuff/img/logo.svg" alt="Stuff" /></h1>
    <nav id="social">
        <ul>
       <li><a href="#"><img class="svg" src="http://www.rockoco.be/stuff/img/gigs.svg" alt="Gigs" /></a></li>
            <li><a href="https://twitter.com/36STUFF" target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/twitter.svg" alt="Twitter" /></a></li>
            <li><a href="https://www.facebook.com/STUFF.isthebandname" target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/facebook.svg" alt="Facebook" /></a></li>
            <li><a href="https://soundcloud.com/stuffmusic" target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/soundcloud.svg" alt="Soundcloud" /></a></li>
            <li><a href="http://stuffmusic.bandcamp.com/" target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/bandcamp.svg" alt="Bandcamp" /></a></li>
            <li><a href="https://www.youtube.com/user/duststuff/videos " target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/youtube.svg" alt="Youtube" /></a></li>
            <li><a href="mailto:[email protected]"><img class="svg" src="http://www.rockoco.be/stuff/img/contact.svg" alt="Contact" /></a></li>
        </ul>
        <ul>
             <li><a href="[email protected]" target="_blank"><img class="svg" src="http://www.rockoco.be/stuff/img/remixes_@_ab_klein.svg" alt="Remixes" /></a></li>   
        </ul>
    </nav>
    </div>
    <footer>
        <a class="left" href="http://www.minguely.ch" target="_blank"><img src="http://www.rockoco.be/stuff/img/logo_minguely.png" alt="" /></a>
            <a class="right" href="http://www.martincramatte.com/" target="_blank"><img src="http://www.rockoco.be/stuff/img/logo_martincramatte.png" alt="" /></a>
    </footer>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script>
    $(document).ready(function() {
    $('#popup').hide();
    $('.svg').click(function() {
    $('#popup').show()
    $(document).ready(function() {
    $('.closeWindow').click(function() {
    $('#popup').hide()
    </script>
    </body>
    </html>

  • Need some help with a bottom up recursive query

    I need to query some hierarchical data. I've written a recursive query that allows me to examine a parent and all it's related children using an adjacency data model. The scenario is to allow users to track how columns are populated in an ETL process. I've
    set up the sample data so that there are two paths:
    1. col1 -> col2 -> col3 -> col6
    2. col4 - > col5
    You can input a column name and get everything from that point downstream. The problem is, you need to be able to start at the bottom and work your way up. Basically, you should be able to put in col6 and see how the data got from col1 to col6. I'm not sure
    if it's a matter of rewriting the query or changing the schema to invert the relationships. Any input is welcome. Sample code below.
    DECLARE @table_loads TABLE (column_id INT, parent_id INT, table_name VARCHAR(25), column_name VARCHAR(25))
    DECLARE @column_name VARCHAR(10)
    INSERT INTO @table_loads(column_id, parent_id, table_name, column_name)
    SELECT 1,NULL,'table1','col1'
    UNION ALL
    SELECT 2,1,'table2','col2'
    UNION ALL
    SELECT 3,2,'table3','col3'
    UNION ALL
    SELECT 4,NULL,'table4','col4'
    UNION ALL
    SELECT 5,4,'table5','col5'
    UNION ALL
    SELECT 6,3,'table6','col6'
    SELECT * FROM @table_loads
    SET @column_name = 'col1'
    WITH load_order(column_id, parent_id,table_name, column_name)
    AS(
    SELECT column_id, parent_id,table_name, column_name
    FROM @table_loads
    WHERE column_name = @column_name
    UNION ALL
    SELECT tl.column_id, tl.parent_id, tl.table_name, tl.column_name
    FROM load_order lo
    JOIN @table_loads tl
    ON lo.column_id = tl.parent_id
    SELECT * FROM load_order

    Got it. It required a VERY subtle change in the join code:
    WITH load_order(column_id, parent_id,table_name, column_name)
    AS(
    SELECT column_id, parent_id,table_name, column_name
    FROM @table_loads
    WHERE column_name = @column_name
    UNION ALL
    SELECT tl.column_id, tl.parent_id, tl.table_name, tl.column_name
    FROM @table_loads tl
    JOIN load_order lo
    ON lo.parent_id = tl.column_id
    SELECT * FROM load_order

  • Help with installing Office for Mac 2011 when I do not have the disks on another machine

    I have a purchased legal version of Office for Mac 2011 on my personal laptop, and I just purchased one for the house (kids).  I do not have the original product key.  How do I get it registered so I can download a version to install on the laptop? 
    I have also logged in (or created accounts) with my two e-mail addresses, but it says neither is associated with Office.  I am not sure what to do.  Thx!!

    Hi,
    This forum is to discuss problems of Office development such as VBA, VSTO, Apps for Office .etc. But I find your question is related to the installing of Office for Mac 2011. So I suggest you posting it in Office
    for Mac support for more effective responses.
    Thanks.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Help with Date function in sql query....

    My question I guess is really 2...I'm trying to use the date function as a comparison in my WHERE clause in my sql command.
    1. My date format is dd-MMM-yy eg. (01-Apr-06) ... my problem is the Apr is lower case where my field in the database is 01-APR-06 so when I compare 01-Apr-06 to 01-APR-06 is doesnt find any rows. Is there away that I can make the Apr all upper case so that it is APR.
    2. My second problem is getting this "date" field to work in my sql stmt I keep getting errors and it works fine if I take my attempts at trying to compare the date.
    --------------Date Code----------------------------------------------------------
    <%!
    String getFormattedDate(java.util.Date d)
    SimpleDateFormat simpleDate = new SimpleDateFormat("01-MMM-yy");
    return simpleDate.format(d);
    %>
    <%
    java.util.Date d = new java.util.Date();
    String dateString = getFormattedDate (d);
    %>
    ---------------------------Sql statment------------------------------------------
    ResultSet rset = stmt.executeQuery ("SELECT name " + " FROM table where rdate = '01-APR-06' order by name ");
    Currently Im just hard coding the date but I need to make it so it uses the date code...so....
    rdate should equal the date from the formatted date in upper case
    something like
    rdate = <%= dateString %>
    Thanks in advance for any ideas anyone may have...

    There are sql functions upper & lower.
    SELECT name  FROM table where upper(rdate) = '01-APR-06' order by name Or you could convert the date to a string, and use the toUpperCase & toLowerCase java.lang.String methods. It doesn't make much of a difference--do you want the java compiler to do the string conversion or the database?

Maybe you are looking for

  • Logical table does not join to any logical table

    HI, I want to implement Business Unit hierarchy for drill down in OBIEE  so I've created a custom table with the hierarchy information, I've imported that table in the out-of the box physical schema & defined a relationship between the W_ORG_D table

  • My Macbook Pro with Retina display screen keeps flickering a ghost screen.

    My Macbook is a year and a half old, and has never been dropped or damaged.  A few months ago, the screen started flickering.  Not like off and on, but a ghost screen would flicker on top of what I was doing.  It is usually the same window that I hav

  • How to remove Hard Drive in E45t-A4100

    I would like to know how to remove the hard drive of my Toshiba Satellite E45t-A4100. I have run into a problem and before reinstalling Windows and losing any data, would like to get a backup (if possible) of my stuff. Thanks in advance. Solved! Go t

  • Frame Controls: Anti-Alias & Details Level

    Can anyone give me a general rule of thumb as to when these need to be used, and exactly how much. 1-100 seems like a lot of leeway... Thanks.

  • I have no clue help

    I am new to spry and I am trying to use it to do a simple task. I want to have 2 lists one being Make (ie make of the car} and the other Model (ie model of the car). And you select the make and it lists the models for that make and once you select th