SQL in one line

Is there a direct SQL (without a plsql block) that we can write to get the rows returning from a SQL into one line
If there are 3 rows like below
S01, test1, 001
S02, test2, 002
S03, test3, 003
Something that we can get all these rows in one row
S01, test1, 001, S02, test2, 002, S03, test3, 003
any help

select max(sys_connect_by_path (t.id||'-'||t.name||'-'||t.name2,','))  from  ( select id,
                        name,
                        name2,
                        row_number() over (order by id) rn
                   from ( select '001' id, 'test1' name, 'S01' name2  from dual
                          union
                          select '002' id, 'test2' name, 'S02' name2 from dual
                          union
                          select '003' id, 'test3' name, 'S03' name2 from dual )  ) t
start with t.rn = 1 and id = 1
connect by t.rn = prior t.rn + 1

Similar Messages

  • How do I create 2 motion tweens for one line of text?  the text needs to "fly-in-right", I can do that,

    how do I create 2 motion tweens for one line of text?  the text needs to "fly-in-right", I can do that, then it needs to "fly-out-bottom" again, I can do that, but not on the same line of text...any ideas...

    my question
    1- there is any way to assign the Fetch process to specific region so the process take all item in these region only.
    2- how can create manual process to fetch row into specific items in page ( i tray these code
    SELECT col1, col2, col3 ....
    INTO :P1_ITEM1, :P1_ITEM, :P1_ITEM...
    FROM table
    WHERE id = :P_id ) but no data retrieve .
    I do not think that it is possible to have more than one Automated Row Fetch process in a given page. See the thread:
    ORA-01403: no data found : Unable to fetch row multiple automated row fetch
    On your second question, the manual process should work provided:
    P_ID has a value when the process executes. You can do it this way:
    i. Make this process as a on-load After/Before header process
    ii. Make sure that P_ID page item has value when the process executes (set it from another page or before the pl/sql process executes)

  • Show Top n Values on One Line

    I have my SSRS report to show the top 3 volumes by physician. My problem is it shows them in three lines going down, even though the code is in one cell. Such as:
    Dr Smith
    Dr Johnson
    Dr James
    I need it to show as Dr Smith, Dr Johnson, Dr James (all on one line separated by commas). Here is what I have tried:
    =Switch(RunningValue(Fields!Attending_Pract_Name.Value,CountDistinct,Nothing)=1,
    Fields!Attending_Pract_Name.Value) & ", " &
    Switch(RunningValue(Fields!Attending_Pract_Name.Value,CountDistinct,Nothing)=2,
    Fields!Attending_Pract_Name.Value) & ", " &
    Switch(RunningValue(Fields!Attending_Pract_Name.Value,CountDistinct,Nothing)=3,
    Fields!Attending_Pract_Name.Value)
    But it still puts the list going down instead of side by side. Any ideas?

    Hi cpemtp1,
    Based on my understanding, there is a column with a lot of rows. Now, you want to combine data of top three rows into one line, right?
    In Reporting Services, when generating each detail row, it only pass one value of data field into expression. So we can never simply using expression to combine three values within one data field together. Regarding your expression, for each row, if this
    value meets requirement, the expression returns this value, otherwise it returns null value. In your scenario, if you only want to display those top three values in your tablix, I would recommend you create another dataset and combine data of top three rows
    to one line on query level. Please refer to screenshots below:
    Reference:
    Use PATH Mode with FOR XML
    How to combine values from multiple rows of a single column (T-SQL, Microsoft SQL Server, FOR XML PATH, CSV ).
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • Output in one line

    Hi all,
    I have a table T of the kind:
    N
    a
    a
    a
    b
    b
    b
    c
    c
    I want the result as:
    a  b    c
    3   3   2
    For that i have writtena query
    select decode(n,'a',count)a,decode(n,'b',count)b,decode(n,'c',count)c
    from(select n,count(*)count from t group by n);
    But it is giving the output as:
    a      b        c
    3
             3
                        2 How can i get the output in one line?
    Thanks

    DimaCit has given a good solution for when you know how many different values you have in advance. If you do not know this, you can code for a number that is higher than you expect or use generated sql to product the desired output. Also I allow for values that are not valid column names.
    SQL> host type tmp.sql
    set feedback off
    set termout off
    create table t (N varchar2(4));
    insert into t values ('A');
    insert into t values ('A');
    insert into t values ('A');
    insert into t values ('B');
    insert into t values ('b');
    insert into t values ('b');
    insert into t values ('c');
    insert into t values ('c');
    insert into t values ('c');
    insert into t values ('c');
    insert into t values ('c');
    insert into t values ('6');
    insert into t values ('6');
    insert into t values ('6');
    set pagesize 0
    set linesize 32767
    set trimspool on
    column nl newline
    spool tmp.ufi
    prompt select
    select
      ' count(decode(n,'''||n||
         ''',1, null)) "'||n||
         decode(rv,1,'"','",') nl
    from
    (select
       n,
       row_number() over (order by n) rn,
       row_number() over (order by n desc) rv,
       sum(1) over() tot from (select distinct n from t)
    order by rn
    prompt from t;;
    spool off
    set pagesize 50000
    set termout on
    @tmp.ufi
    drop table t;
    SQL> @tmp
             6          A          B          b          c
             3          3          1          2          5
    SQL> Edited by: Old DBA on Feb 5, 2009 8:32 PM
    Formatting

  • One line

    Hi,
    I have this query :
    SQL> SELECT 'SOMETHING',ID_NUMBER FROM TABLE;
    It returns :
    SOMETHING
    5.01.10.001
    How can I do to have all in one line, like following :
    SOMETHING 5.01.10.001
    Many thanks.

    Hi,
    Have a look...
    SQL> create table testtab (id_number varchar2(20));
    Tabelle wurde angelegt.
    SQL> insert into testtab values('5.01.10.001');
    1 Zeile wurde erstellt.
    SQL> SELECT 'SOMETHING',ID_NUMBER FROM testtab;
    'SOMETHIN ID_NUMBER
    SOMETHING 5.01.10.001
    SQL> Maybe it's a matter of linesize (sometimes size matters ;))?
    Rgds,
    Guido

  • Multi query in one line

    hi
    how i can execute multi query (select) in one line without using "Enter" key by sql*plus or Toad ?
    for example , i want to do as following :
    "select * from request_parameter_type where param_name like 'new%' ; / select * from fund ;"
    but it show me "invalid character" error on ";" and force to place "enter" between them :
    select * from request_parameter_type where param_name like 'new%' ;
    select * from fund ;
    thx in adv.
    Edited by: s_hesam_s on Oct 12, 2008 12:29 AM

    You can set the cmdsep variable but it seems just the output of the last statement gets displayed:
    SQL> set cmdsep |
    SQL>
    SQL> select ename from emp | select dummy from dual
      2  /
    D
    X

  • To read more than one line...

    I 've this code but it can read from keyboard only one line
    (when I type enter after the first line an EOF is raised )>
    BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
          String sql = "";
          System.out.println("Enter your JDBC/SQL query: ");
          try {
             sql = buf.readLine(); Someone can help me so that I can enter more than a line ?
    Thanks a lot.

    Do you want the user to entry two queries, one per line, or do you want to allow a single query to
    be entered on two lines?
    What happens when the query is only one line long?
    What happens when the user wants to use more than two lines to enter the text?
    Suggestion: use a loop and use something simple like a blank line to signal
    end of input. It's not hard:
    import java.io.*;
    public class MultilineInputExample {
        public static void main(String[] args) throws IOException {
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            for(int i=0; i < 2; ++i) {
                System.out.println("Enter multiline input. End with a blank line");
                String input = readMultilineInput(in);
                System.out.println("input = [" + input + "]");
        //uses a blank (white space) line to signal the end
        public static String readMultilineInput(BufferedReader in) throws IOException {
            StringBuilder b = new StringBuilder();
            String line;
            boolean notDone = true;
            while (notDone && (line = in.readLine()) != null) {
                if ((notDone = !line.trim().isEmpty()))
                    b.append(line).append(' ');
            return b.toString();
    }

  • Report output on one Line, without new line (cariage return)

    Hello I use a user defined report with style plsql. The output is with many dbms_output.put_line and is displays in only one line. May I ask you to get the output on more the one line. For eatch dbms_output I wont to have a new line (cariage return). Many thanks for help in advance

    In the body of the report, I used HTML tags to control the appearance.
    For example, to see what database features you have used in your database today, the following code works well:
    begin
    dbms_output.enable(1000000);
    dbms_output.put_line('<PRE>');
    for rc in ( select output from
       table(dbms_feature_usage_report.display_text)
               ) loop
       dbms_output.put_line(rc.output);
    end loop;
    dbms_output.put_line('</PRE>');
    end; This yields the following output
    DB FEATURE USAGE report for
    DB Name         DB Id     Release    Total Samples Last Sample Time 
    ABCPROD        900004321 10.2.0.1.0             78 09-Oct-09 18:29:17
    DB Feature Usage Summary                       DB/Release: ABCPROD/10.2.0.1.0
    -> This section displays the summary of Usage for Database Features.
    -> The Currently Used column is TRUE if usage was detected for
    -> the feature at the last sample time.
                                              Curr-                                
                                              ently Detected    Total Last Usage   
    Feature Name                              Used    Usages  Samples    Time      
    Automatic SQL Execution Memory            TRUE        78       78 10/09/09 18:29
    Automatic Segment Space Management (syste TRUE        78       78 10/09/09 18:29
    etc.However if you comment the lines with the beginning and terminating tags for preformatted text, then you get output confined to one line that starts out like:
    DB FEATURE USAGE report for DB Name DB Id Release Total Samples Last Sample Time ------------ ----------- and you'll have to scroll to the right or figure how you want to break it up -- That's too much work.
    My configuration:
    Windows XP SP3
    SQL Developer 1.5.5 Build MAIN-5969
    Java(TM) Platform     1.6.0_06

  • How to enter invoice with two different tax codes in one line?

    Dear friends,
    I have this PO for which I enter the invoice.
    I recieve later a subsequent debit for this PO from the transporter. This subsequent invoice has got extra debits, one with 21% VAT and one with 19% VAT, which means two items with two different tax codes.
    I want to enter this subsequent debit for each item of the PO, and I want to enter both debits in every item of the PO.
    How can I enter in one row in MIRO a debit with two different tax codes.
    Thank you.

    I want in the same line item to enter two tax codes.
    Do you Know if there is any way to do this?
    It is a subsequent debit and it has two items with two different tax codes. I want to enter the subsequent debit for a PO with many items and enter the value of the whole subsequent invoice. So there is the need to enter one line item with two tax codes.
    How can this be done?
    Thank you?

  • How can I display one line at a time on a PPT slide

    I am using OFFICE for the Mac (2008).
    In the past, I have known how to do this using PPT on a Windows PC..
    But something has changed and I can no longer figure out how to get each line on a PPT slide to appear one line at a time every time I click it.
    It's not that difficult, but I can't figured out where they moved the "Appear" option.
    I am NOT using KEYNOTE, but PowerPoint from OFFICE for the Mac (2008)
    Can someone help me.
    Thanks,
    Tom

    Since this is a Keynote discussion forum, there may be no one here that knows. I personally hate PP and could care less about how to make one line display at a time. It is easy on Keynote and that is all I need to know. You might want to look for a PP forum and ask there.

  • How to get the results in one line

    Hi
    if i use the script below i get the name of path and then : and in next line i get the results.is there a way to get the results from every path after the : and not in the next line?
    another question - is there a way that the script will not show the server name on every path?
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter
    THC

    If you take you script and pipe it to get member, it will give you a list of various script properties.
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | get-member
    You will see that the object type returned by "Get-Counter" is Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet.
    TypeName:
    Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet
    Name MemberType Definition
    Equals Method bool Equals(System.Object obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    ToString Method string ToString()
    CounterSamples Property Microsoft.PowerShell.Commands.GetCounter.Perfo...
    Timestamp Property datetime Timestamp {get;set;}
    Readings ScriptProperty System.Object Readings {get=$strPaths = ""...
    You can try grabbing different properties, and they will print out differently, displaying the data on the same line in some cases. For example, pipe your output to a "foreach-object" block, and then for each object print out the CounterSamples property.
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances | Get-Counter | foreach-object { ($_).CounterSamples }
    This should all print on one line now. However, you also asked if there was a way to not have the server print out on every line. The way to control the format of these outputs is to use the "format-table" cmdlet. So you would pipe your output to format-table
    and then give it various options. This is how you would pipe it (without any options).
    (Get-Counter -ListSet LogicalDisk).PathsWithInstances |
    Get-Counter | object { ($_).CounterSamples | format-table }#OR USE YOUR ORIGINAL CODE(Get-Counter -ListSet LogicalDisk).PathsWithInstances |
    Get-Counter | format-table }
    Now, it's up to you to give format-table the options you want. With no options, output will look unchanged. To see what options are available to you, use get-help.
    get-help format-table
    I hope this helps!
    Thank for all the info...

  • Installed a new printer and one line on the top is skipped

    Appreciate your inputs.
    We have been using the 'Check Printing report' for quite a while; We recently installed a new printer and we see that the alignment has gone wrong.
    The checks are printing from one line below as it is skipping one line. Where do we adjust the setting so that the printing starts from the place where we want?
    Thanks in advance

    Hi
    Im no expert but I doubt its a template issue more likely to be the control escape sequence on the printer diriver set up. Check your printer manual and the current set up you have.
    Regards
    Tim

  • Nested If condition in Routine - Literals that take up more than one line

    Hi All,
           I am writing following code at object level of routine but its giving following exception: Please help me on this.
    Exception:
    E:Literals that take up more than one line not permitted.
    CODE:
    IF SOURCE_FIELDS-/BIC/TOTAL >= 900.
        RESULT = 'A.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 800 AND SOURCE_FIELDS-/BIC/TOTAL < 900.
        RESULT = 'B.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 700 AND SOURCE_FIELDS-/BIC/TOTAL < 800.
        RESULT = 'C.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 600 AND SOURCE_FIELDS-/BIC/TOTAL < 700.
        RESULT = 'D'.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 500 AND SOURCE_FIELDS-/BIC/TOTAL < 600.
        RESULT = 'E'.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 400 AND SOURCE_FIELDS-/BIC/TOTAL < 500.
        RESULT = 'F.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 350 AND SOURCE_FIELDS-/BIC/TOTAL < 400.
        RESULT = 'G.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 300 AND SOURCE_FIELDS-/BIC/TOTAL < 350.
        RESULT = 'H.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 200 AND SOURCE_FIELDS-/BIC/TOTAL < 300.
        RESULT = 'I.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 0 AND SOURCE_FIELDS-/BIC/TOTAL < 200.
        RESULT = 'J.
    ENDIF.
    Thanks in advance.
    Anitha.B

    Hi Anitha
    Just check
    RESULT = 'A.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 800 AND SOURCE_FIELDS-/BIC/TOTAL < 900.
    RESULT = 'B.
    ELSEIF SOURCE_FIELDS-/BIC/TOTAL >= 700 AND SOURCE_FIELDS-/BIC/TOTAL < 800.
    RESULT = 'C.
    Whether it needs to be under two quotes. I feel one is missing. it should be 'A' and not just 'A.
    Regards
    Sriram

  • In this report i have marked one line..if this width 30,i need to multiply by a number 0.3 and if the width =30,it multiplies by 0.37...how to use this logic here..??? anyone can help??

    In this report i have marked one line..if this width < 30,i need to multiply by a number 0.3 and if the width >=30,it multiplies by 0.37...how to use this logic here..??? anyone can help??
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @SCCode nvarchar(30)
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]'
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
    --Rcpt from PRDN (Condition checked for Return component exclusion also)
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'FG Item Code',
    T3.ItemName as 'FG Item Name',
    T2.PlannedQty as 'FG Planned Qty',
    T2.U_OD as 'OD',
    T2.U_ID as 'ID',
    T2.U_OD/25.4 as 'Inches',
    (T2.U_OD-T2.U_ID)/2 as 'Width',
    0 as 'FG Pending Qty',
    0 as 'FG Receipt Qty',
    '' as 'Issue Item Code',
    '' as 'Issue Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    0 as 'Issue Item - Return Quantity',
    '' as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode not in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode INNER JOIN OIGN d on c.DocEntry = d.DocEntry
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID, T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2
    UNION ALL
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'Item Code',
    T3.ItemName as 'Item Name',
    T2.PlannedQty as 'Planned Qty',
    T2.U_OD as 'OD',
    T2.U_ID as 'ID',
    T2.U_OD/25.4 as 'Inches',
    (T2.U_OD-T2.U_ID)/2 as 'Width',
    (Select (T2.PlannedQty - (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum))) as 'Pending Qty',
    (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum) as 'Receipt Qty',
    a.ItemCode as 'Issued Item Code',
    a.Dscription as 'Issued Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    (Select (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode))) as 'Issue Item - Return Quantity',
    (ISNULL((Select (Select a2.DocNum from OIGN a2 where a2.DocEntry = a1.DocEntry) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode)),'')) as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode LEFT JOIN OIGN d on c.DocEntry = d.DocEntry 
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID,T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2,a.ItemCode,a.Dscription    order by T2.DocNum desc

    Hi,
    Try this:
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @SCCode nvarchar(30)
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]'
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
    --Rcpt from PRDN (Condition checked for Return component exclusion also)
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'FG Item Code',T3.ItemName as 'FG Item Name',T2.PlannedQty as 'FG Planned Qty',T2.U_OD as 'OD',T2.U_ID as 'ID',T2.U_OD/25.4 as 'Inches',(T2.U_OD-T2.U_ID)/2 as 'Width',case when ((T2.U_OD-T2.U_ID)/2) <30 then ((T2.U_OD-T2.U_ID)/2) *0.3 end, 0 as 'FG Pending Qty',0 as 'FG Receipt Qty','' as 'Issue Item Code','' as 'Issue Item Name',Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',0 as 'Issue Item - Return Quantity','' as 'Return Doc No',SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntryINNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCodeLEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode not in (a.ItemCode)LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode INNER JOIN OIGN d on c.DocEntry = d.DocEntryWHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID, T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2UNION ALL SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'Item Code',T3.ItemName as 'Item Name',T2.PlannedQty as 'Planned Qty',T2.U_OD as 'OD',T2.U_ID as 'ID',T2.U_OD/25.4 as 'Inches',(T2.U_OD-T2.U_ID)/2 as 'Width',case when ((T2.U_OD-T2.U_ID)/2) >=30 then ((T2.U_OD-T2.U_ID)/2) *0.37 end, (Select (T2.PlannedQty - (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum))) as 'Pending Qty',(Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum) as 'Receipt Qty',
    a.ItemCode as 'Issued Item Code',
    a.Dscription as 'Issued Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    (Select (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry
    where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode))) as 'Issue Item - Return Quantity',
    (ISNULL((Select (Select a2.DocNum from OIGN a2 where a2.DocEntry = a1.DocEntry) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode)),'')) as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode LEFT JOIN OIGN d on c.DocEntry = d.DocEntry
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,
    T2.PlannedQty,T2.U_OD,
    T2.U_ID,T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2,a.ItemCode,a.Dscription  
    order by T2.DocNum desc
    Thanks & Regards,
    Nagarajan

  • Why does pressing the down arrow button result in going to the bottom of the page and being nunable to go up or down one line at a time?

    i dont know what to say in way of clarification. when looking at a page i am forced to use the "slide" on the margin which is very sensitive on very long documents instead of the down arrow to move one line. pressing the arrow results in going to the bottom and you cant return using the arrow.

    The arrow to open the tab history of the Back and Forward buttons has been removed in Firefox 4 and later.
    Use one of these methods to open the tab history list:
    * Right click on the Back or Forward button
    * Hold down the left mouse button on the enabled Back or Forward button until the list opens
    You can look at this extension:
    * Backward Forward History Dropdown: https://addons.mozilla.org/firefox/addon/backforedrop/

Maybe you are looking for

  • When creating a fillable form fields from an existing pdf file, how do you set or allow end user to set the font size in the fields?

    I successfully created a form filled pdf using an existing pdf document.  However, the font size is too large to allow end user to type in information in the form box.  Is there a way to 1)globally set all  of the form fields when generated to a much

  • Database Mail not working with SQL Server Agent

    I'm running SQL Server 2005 Standard edition 64 bit with SP2 on a 64 bit machine.  Database mail does not work with SQL Server Agent.  When I configure SQL Server Agent to use database mail the test email button is greyed out and inactive therefore I

  • Best Tablet for Mobile Gaming Questions (?)

    Guys, right now, what's the best tablet out there for mobile gaming?  The best tablet/phone optimized for mobile gaming as well? (like Modern Combat 4, etc.) What's the tablet that has the best GPU? (I know Tegra 4 is around the corner but I only wan

  • Exchange 2000 portlets time out

    Running the exchange ASPs both in an empty browser window and as portlets goes awfully slow. Adding all three portlets to one page makes at least one of them time out, regardless of the timeout setting. Running only one takes up to ten seconds to com

  • Screen will not open on my iMac

    My screen will not open. I get the Apple and the little whirligig but that is it. It just keeps going around for about four seconds.