DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: how to combine following two queries so that it return the result for differen dates

  1. #1
    Join Date
    Jan 2013
    Posts
    1

    how to combine following two queries so that it return the result for differen dates

    how to combine following two queries so that it return the result for both dates separably in the oracle form -oracle report -or excel work sheet
    Is this possible to use any functionality in access query that when import the queries to excel it display the info on the same excel worksheet and in different columns .
    i need to display the result for each week separately but want to use the same work sheet for this .

    *************query1**********
    SELECT Telco, Reason, Count(*)
    FROM table1
    WHERE date between '1/1/2013# And'1/7/2013'
    GROUP BY Telco,Reason
    ORDER BY Telco;


    **********query2***********
    SELECT Telco, Reason, Count(*)
    FROM table1
    WHERE date between '1/8/2013# And'1/13/2013'
    GROUP BY Telco,Reason
    ORDER BY Telco;

  2. #2
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    How does this look?

    Code:
    SELECT TRUNC(date, 'WW'), TELCO, REASON, COUNT(*)
      FROM TABLE1
     WHERE DATE > TRUNC(SYSDATE, 'YYYY')
     GROUP BY TRUNC(DATE, 'WW'), TELCO, REASON
     ORDER BY 1,2,3;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width