One query, two diffrent outputs
Hiho,
i have got a ABC - Analysis in the business partner data. there are 2 related fields. U-umsatz (for total sales) and U_gruppe (for the kind of business partner). Related from this both udf u should get an A, B or C.
The udt is a matrix with relations between sales and kind of bp.
I wrote this query
SELECT TOP 1 T0.[U_Klasse] FROM [@KUNDENKLASSE] T0 WHERE T0.[U_Umsatz] < $[OCRD.U_umsatz] AND T0.[U_gruppe] = $[OCRD.U_Klasse] ORDER BY T0.[U_Klasse]
Sometimes i got the correct output, sometimes not. I thought i could be the thousend sep., but it wasnt.
any ideas ?
regards
ok, so the problem is formating of thousand (I hope you have space as separator). Try it as
SELECT TOP 1 T0.U_Klasse FROM dbo.@KUNDENKLASSE T0 WHERE
convert(numeric(9,6), replace(convert(varchar(100), coalesce(T0.U_Umsatz, 0)), ' ', ''))
<
convert(numeric(9,6), replace(convert(varchar(100), coalesce($http://OCRD.U_umsatz, 0)), ' ', ''))
AND T0.U_gruppe = $http://OCRD.U_Klasse ORDER BY T0.U_Klasse
Similar Messages
-
Mac Pro with two graphic card each one with two dvi output, can I extend deskop to three outputs?
MAC OS 10.7.4 3.2GHz Quad-Core Intel Xeon processors, 12GB of 800MHz DDR2 and 2 ATI Radeon HD 2600 XT 256MB (two dual-link DVI ports) . The problem is, I woul like to use one output as main and the three others as secondary or extended desktop but the system don't allow me use two diferent video cards this way.
-
One query two different Group By
In My parameter two option one and two.
if i select one, need to come this group by:-
GROUP BY
Name1,
Name2,
Country,
MCC || '/' | MNC
One Output:
Name1 - Name2 - Country - PNR
if i select two, need to come this group by
GROUP BY
Name1,
Country,
MCC || '/' | MNC
two output :
Name1 - Country - PNR
I have only one sql query But i have two different group by
Please advise me, m not using subreport option.
whether any formulas or any other options for group by.Try inserting the groups statically that are common for both the parameaters like this
GROUP BY
Name1,
Country,
MCC || '/' | MNC
and now create a formula like this
whilereadingrecords;
if =1 then
{Name2 field}
else
Now insert one more group using this formula and move the group to second level by using group options.
Hope this helps!
Raghavendra -
Oracle Reports : one query - two reports?
Help, please, Oracle Reports 10g.
I have a query, need to make two reports in one. They are similar, just couple parameters are different, say, entreprise type and region;
How do I display these two reports in one? I tried to make parameters as placeholders, package variables, put an trigger on outer frames for reports. parameters do change their values but just the same report displays twice. where is the trick?
Thank youThe way I have done this in the past was to create 2 master frames, 1 for each report and then put conditions on each frame as to when it is to appear. Hope this helps..
-
One Query, Two Datasources
Is there a way to run a query on two separate datasources? I
would like to compare the data in two separate MS Access databases.
Thanks.You won't be able to combine two datasources in one cfquery,
so one way might be for you to query each datasource, then compare
the two results using a Q-of-Q.
Phil -
Hi i have a system that control car acidents ..
I have a query that return the streets from a choosed city, and after i ask if the crash happens in streets crossings,
So i get the variable $street
If so i do the same query to return the same streets to the user choose the street crossing.
So i get the variable $street_crossing
I only need assign diferent variables names to handle the street and the street crossing.
Is there any way to not go to the database to do the same work that already is done? and get the previous query result ? i am using php and oracle
thanks in advanceAfter the query, the street list is in $results_crzmt_logr. You
should be able to print this array twice. The first time with
headings for "Street" and the second time for "Street Crossing".
For performance reasons the query may benefit from a bind variable.
Something like:
$cmdstr_crzmt_logr = "SELECT NOME, ".
"B, ".
"CEP, ".
"FROM TABLE ".
"WHERE MUNIC=:mun ".
"ORDER BY NOME ASC";
$parsed_crzmt_logr = ociparse($db_conn, $cmdstr_crzmt_logr);
OCIBindByName($parsed_crzmt_logr, ":mun", $_POST[MUN_CODIGO], 10);
ociexecute($parsed_crzmt_logr);
$nrows_crzmt_logr = ocifetchstatement($parsed_crzmt_logr, $results_crzmt_logr);Adding error checking may be useful. The free statement should be:
OCIFreeStatement($parsed_crzmt_logr);-- CJ -
GUI - How do i merge two diffrent layout managers into one tab?
Hello
I want to create a cellphone, and when you click a button it will be displayed in a textfield
the buttons are in a grid layout (4,3) and the textfield is in a border layout (NORTH)
I have the layouts in two seperate tabs, but how do i merge two diffrent layouts in to one tab ?
textfield:
package guitelefon;
import java.awt.*;
import javax.swing.*;
public class BorderPanel extends JPanel
public BorderPanel()
setLayout (new BorderLayout());
setBackground (Color.green);
JTextField output = new JTextField(5);
add (output, BorderLayout.NORTH);
}Buttons:
package guitelefon;
import java.awt.*;
import javax.swing.*;
public class GridPanel extends JPanel
public GridPanel()
setLayout (new GridLayout (4, 3));
setBackground (Color.green);
JButton b1 = new JButton ("1");
JButton b2 = new JButton ("2");
JButton b3 = new JButton ("3");
JButton b4 = new JButton ("4");
JButton b5 = new JButton ("5");
JButton b6 = new JButton ("6");
JButton b7 = new JButton ("7");
JButton b8 = new JButton ("8");
JButton b9 = new JButton ("9");
JButton bs = new JButton ("*");
JButton b0 = new JButton ("0");
JButton bf = new JButton ("#");
add (b1);
add (b2);
add (b3);
add (b4);
add (b5);
add (b6);
add (b7);
add (b8);
add (b9);
add (bs);
add (b0);
add (bf);
}driver:
package guitelefon;
// LayoutDemo.java Java Foundations
// Demonstrates the use of flow, border, grid, and box layouts.
import javax.swing.*;
public class LayoutDemo
public static void main (String[] args)
JFrame frame = new JFrame ("Cellhpone");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
JTabbedPane tp = new JTabbedPane();
tp.addTab ("Grid", new GridPanel());
tp.addTab ("Border", new BorderPanel());
frame.getContentPane().add(tp);
frame.pack();
frame.setVisible(true);
}a simple example with compilable code:
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.*;
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame("Cellhpone");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel(new BorderLayout());
panel.add(new FooPanel(), BorderLayout.CENTER);
panel.add(new BarPanel(), BorderLayout.NORTH);
frame.getContentPane().add(panel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
class FooPanel extends JPanel {
private static final String[][] BTN_STRINGS = {
{"1", "2", "3"},
{"4", "5", "6"},
{"7", "8", "9"},
{"*", "0", "#"}};
public FooPanel() {
setLayout(new GridLayout(BTN_STRINGS.length, BTN_STRINGS[0].length, 5, 5));
for (int row = 0; row < BTN_STRINGS.length; row++) {
for (int col = 0; col < BTN_STRINGS[row].length; col++) {
JButton btn = new JButton(BTN_STRINGS[row][col]);
add(btn);
class BarPanel extends JPanel {
private JTextField field = new JTextField();
public BarPanel() {
setLayout(new BorderLayout());
add(field, BorderLayout.CENTER);
}Edited by: Encephalopathic on Oct 29, 2009 7:56 AM -
Two different results using one query
Hi Friends
Oracle version that I am using is : Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
I have a scenario where one account can be related to two customers. Hence, in table have many rows for one account. Here’s the sample data:
Account_ID | product_code | cust_id | relationship_code | entity_code
1111 | ABC | 1234 | SOL | CUST
1111 | ABC | 2222 | ZZZ | LINK
1111 | ABC | 4455 | ABC | LINK
2222 | ABC | 7890 | SOL | CUST
2222 | ABC | 5678 | ZZZ | LINK
3333 | JFK | 5878 | TST | CUST
3333 | JFK | 3254 | PRI | CUST
3333 | JFK | 3299 | PRI | CUST
4444 | JFK | 2535 | SOL | CUST
4444 | JFK | 4565 | SOL | CUST
5555 | DEF | 6666 | PRI | CUST
5555 | DEF | 6667 | TST | CUST
5555 | DEF | 9667 | TST | CUSTIn this scenario, I need two outputs differently:
Output 1: When an account has relationship_code = ‘SOL’ then take the least cust_id
1111 | ABC | 1234 | SOL | CUST
2222 | ABC | 5678 | ZZZ | LINK
4444 | JFK | 2535 | SOL | CUST Output 2: else take the highest cust_id
3333 | JFK | 5878 | TST | CUST
5555 | DEF | 9667 | TST | CUSTHow can I get this result using one query?Not sure what you mean. Works OK:
SQL> with t as (
2 select 1111 account_ID,'ABC' product_code,1234 cust_id,'SOL' relationship_code,'CUST' entity_code from dual union all
3 select 1111,'ABC',2222,'ZZZ','LINK' from dual union all
4 select 1111,'ABC',4455,'ABC','LINK' from dual union all
5 select 2222,'ABC',7890,'SOL','CUST' from dual union all
6 select 2222,'ABC',5678,'ZZZ','LINK' from dual union all
7 select 3333,'JFK',5878,'TST','CUST' from dual union all
8 select 3333,'JFK',3254,'PRI','CUST' from dual union all
9 select 3333,'JFK',3299,'PRI','CUST' from dual union all
10 select 4444,'JFK',2535,'SOL','CUST' from dual union all
11 select 4444,'JFK',4565,'SOL','CUST' from dual union all
12 select 5555,'DEF',6666,'PRI','CUST' from dual union all
13 select 5555,'DEF',6667,'TST','CUST' from dual union all
14 select 5555,'DEF',9667,'TST','CUST' from dual union all
15 select 6666,'XYZ',8877,'SOL','CUST' from dual
16 )
17 select account_ID,
18 product_code,
19 cust_id,
20 relationship_code,
21 entity_code
22 from (
23 select account_ID,
24 product_code,
25 cust_id,
26 relationship_code,
27 entity_code,
28 case max(case relationship_code when 'SOL' then 1 else 0 end) over(partition by account_ID)
29 when 1 then dense_rank() over(partition by account_ID order by cust_id)
30 else dense_rank() over(partition by account_ID order by cust_id desc)
31 end rnk
32 from t
33 )
34 where rnk = 1
35 /
ACCOUNT_ID PRO CUST_ID REL ENTI
1111 ABC 1234 SOL CUST
2222 ABC 5678 ZZZ LINK
3333 JFK 5878 TST CUST
4444 JFK 2535 SOL CUST
5555 DEF 9667 TST CUST
6666 XYZ 8877 SOL CUST
6 rows selected.
SQL> SY. -
IMac: using two monitor outputs as one
Hello! We are using last generation 23" iMac at a church with GTX 750m. It has two thunderbolt outputs. I want to use both ports to send same signal: one to VGA projectors with 1024x768 resolution and second to HDMI live broadcasting equipment with 1080x1920 resolution. Problem is that presentation software can send signal to one of them but not to both. Is there a way to parallel thunderbolt ports or to combine them in one using third party software?
Hello! We are using last generation 23" iMac at a church with GTX 750m. It has two thunderbolt outputs. I want to use both ports to send same signal: one to VGA projectors with 1024x768 resolution and second to HDMI live broadcasting equipment with 1080x1920 resolution. Problem is that presentation software can send signal to one of them but not to both. Is there a way to parallel thunderbolt ports or to combine them in one using third party software?
-
Update SAME column name in two tables from ONE query
Dear All Seniors
Please tell me is it possible to update a same column name in two tables.
I have two tables in same schema
(1)table name
pem.igp_parent
column name
igp_no.
igp_type
(2)table name
pem.igp_child
column name
igp_no.
igp_type
i want to update igp_no column in one query please tell me how it would be possible.
thanks
yassenYou want to update the data from what to what? Where is the new data coming from?
If you are trying to put the same data in two different tables, that strongly implies that you have a normalization problem that needs to be addressed.
Why do you want a single query rather than updating each table in turn? Can you join the two target tables to produce a key-preserved view?
Justin -
How can i write two ?DDL in one query
how can i write two ?DDL statment in one query?
Issuing two DDL statements requires two edxecutions. Getting around it is possible by creating a procedure that issues the two DDL statements. But they would still have to be issues one at a time, but you would only have to write one statement to invoke it.
-
Output of One Query is input to other Query??
Hi All,
How to make output of one query as input to other Query and what are the points to be takeb care of to do it?
regards,
murali.
Message was edited by: MuraliHallo
You got a second query where you also have 0date. Based on the selection on the second query, you get some value for 0date. this values are then passed in background to the first query which will show you the output based on the input date of the first query. You can also have othe variable in the query.
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
I hope everything is fine.
Mike -
How to use output of one query as an input for another
Hi Gurus,
can you give me any links on how to use an output of one query as an input for another (preferably if this can be done in a dynamic/on the fly way)?
thanksYou can use Replacement Path Variable for this purpose. See this detailed documentation.
http://help.sap.com/saphelp_nw04s/helpdata/en/bd/589b3c494d8e15e10000000a114084/content.htm
Abhijit
Edited by: ABHIJIT TEMBHEKAR on Nov 19, 2008 9:48 AM -
I am using an NI PCI 6024 E board device for an analog output application. Can I generate two independent waveforms, one on each analog output channel? In attach I send a example of my vi to control one chanel, but i need to control both but with diferent waveforms.
Is the vi correctly programed to this propose?Yes you should be able to do that. look at the signal generation examples shipped with LabView
You can create a 2 D array, with each row representing a wave form per channel. The number of points of the wave form (per row of the 2 D array) represent the number of points in the output buffer
The wave forms can have different amplitudes/shapes, and therefore they are independent in this sense.
However, you need to set the update rate,which is the same for both channels. The update rate together with number of points per buffer determines the frequency of the wave forms. This means the two wave forms will have the same frequency.
To have different frequencies, you need to have say, on wave form with one cycle per buffer, and the other waveform have 2 cycles
per buffer. in a case like that the frequency of the second channels is twice that of the first channel, and so on
The two wave forms are then not truly independent, they may have different amplitudtes/shapes, but related in frequency. -
Make one query of two queries?
I have these two quries, how can I at the best way get the same result in one query?
--Querie 1
SELECT 'm' || Year_Month As Month,
Sum(NET_SALES) As "Net Sales"
FROM tlbInfo
WHERE Year_Month Between '200709' And '200801'
And record_type IN ('A','X')
Group by Year_Month
Order by Year_Month
--Querie 2
SELECT 'm' || Year_Month As Month,
Sum(STANDARD_MANUF_COST)/Sum(Case When SALES_QUANTITY <> '0' Then SALES_QUANTITY End) As "Cost",
to_char(100*((sum(NET_SALES)-sum(STANDARD_MANUF_COST))/sum(NET_SALES)) || '%') As "Margin"
FROM tlbInfo
WHERE Year_Month Between '200709' And '200801'
And record_type NOT IN ('A', 'X')
And Net_Sales >0
Group by Year_Month
Order by Year_Monthwhy did you change the 1st query? now you're further from getting the correct answer (not to mention that now my previous post makes no sense).
put the 1st query back to the way it was. then change the 2nd query to remove the record_type and net_sales criteria from the where clause, and instead put the logic into the select, via a CASE, like the first query is written.
now look at the two new queries, and ask yourself, what's so hard about making one query?
and don't do this work in the original post. do it in notepad. and if you want to post the new queries here to get further help, hit the REPLY button, NOT THE EDIT BUTTON
Maybe you are looking for
-
Hp6390a freezes up then switches off
Having a lot of problems with computer always switching off. I did a system test with PC doctor and it switches off every time I do it . Then when it comes back on says windows error recovery. I tried everything system restore, cleaned dust inside, a
-
How we can use call transaction xd03 in alv report
hey guys i want now that how we can use call transaction xd03 in alv report by using various tables in report or coding. can you tell me about that by the way of coding so that it can be easy for me to understand and help ful to make report by using
-
Need Guidance on s/w Architecture for Server PDF Creation & File Merge App
Please send me your recommendation on how to tackle this design requirement with the correct adobe software products. Let me know the s/w architecture you recommend too. My client has a microsoft office 2010 application customized via VBA which is o
-
Where to download BR*tools Studio 7.10?
Hello experts, I am trying to download and install BR*Tool Studio 7.1 for our Oracle databases in our SAP environment but I cannot find the download anywhere. Please someone point me to the download link. Do I need to have license to run this softwar
-
Can InDesign CC open PageMaker files?
I'm trying to open some old PageMaker files using InDesign CC and it doesn't seem to work. Do I need a plug-in?