How can I display summary for every 15 minutes using DATE datatype

This is probably an easy question, but the answer eludes me...
I am trying to write a SQL report that displays aggregate totals for every 15 minute period. I know you can do something like this to get every minute:
select to_char(import_date,'MM-DD-YYYY HH24:MI'),
count(*) from
package_ingest
group by to_char(import_date,'MM-DD-YYYY HH24:MI')
But how can I change this query so that I get every 15 minutes?
Any feedback is greatly apprecaited!
Thanks,
-ADK

Hi,
GROUP BY  TRUNC (SYSDATE) + FLOOR ( (import_date - TRUNC (SYSDATE))
                                      * 24
                        * 4
                        )SYSDATE is an arbitrary reference point. It doesn't matter if import_date is earlier or later (or sometimes earlier and sometimes later).
If you want to display this in the SELECT clause, or use it in the ORDER BY clause, then repeat the expression there, or compute it once in a sub-query.
WITH  got_i_d_15     AS
     SELECT     TRUNC (SYSDATE) + FLOOR ( (import_date - TRUNC (SYSDATE))
                                           * 24
                             * 4
                             ) AS i_d_15
     FROM     package_ingest
--     WHERE     ...          -- If needed
SELECT       TO_CHAR (i_d_15, 'MM-DD-YYYY HH24:MI')     AS import_date
,       COUNT (*)                               AS cnt
FROM       got_i_d_15
GROUP BY  i_d_15
ORDER BY  i_d_15;

Similar Messages

  • How can I display current iPhone GPS coordinates using compass app

    How can I display current iPhone GPS coordinates, when traveling overseas with no access of data or wifi
    using "iphone compass app"(Both the latitude and longitude) ??
    if iphone compass app require any sort of data
    what alternative would there be? (to document the coordinates)?

    Hi
    Iphone 5s 16 gb 8.1
    My fone freeze whenever i charge my fone its appear white screen with apple logo.. and as soon as i try to press hold home and power button
    it shows battery drained sign>> i m facing this problem from last one week
    and itunes also not  getting cconnected
    can any1 please help me out
    sorry for poor english

  • How can I dock icons for every opened windows?

    Hello all,
    First time poster here and first time owner of Mac.  I want to know how I can get all opened windows to show as icons on the dock.  On a Windows OS, any opened window will have an icon on the Taskbar.  Does a Mac OS have the same feature?  And no, I don't want to use the old Expose.  I want to be able to get to an opened window that is hidden behind another window by just one click, instead of moving windows around (so that I can get my intended window to be where I can click on it), or instead of using Expose.
    One way to get the opened windows to appear on the dock is to miminize it.  I find that to be burdensome, especially if you're openeing a lot of windows quickly.  I want to be able to switch between opened windows in just one click.
    Any help would be appreciated.  Thank you.

    You need to either control-click on the application's Dock icon and then regularly click on the item representing that window, or to click and hold the application's icon until the menu appears, and then releasing the button when the cursor is over the menu item.
    (71155)

  • How can I display records quickly in order, using set_block_property

    Hi all,
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.
    Thanks in advance.

    Hi user;
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.Did you try to use index for related column? Also did you try to use order_by instead of default_where
    If its not help, I also suggest post your issue on :Forum Home » Developer Tools » Forms
    Hope it helps
    Regard
    Helios

  • How can I assign authorizations for the Flight list data?

    Hello,
    I am doing the Web Dynpro tutorial for calling BAPIs from Web Dynpro.
    I have finished it successfully but I don't get any data back. When I checked this BAPI with SE37 I receive a message "No Authorization" at the RETURN parameter.
    My question is: How can I assign myself these authorizations?
    I am not a BW person so a step-bystep explanation will be very helpful...
    Roy
    Message was edited by:
            Roy Cohen

    hi jaya....
    1. you need generate the table maintenance using the Menu Utilities->Table maintenance generator
    2. give the authorization group, package, function group, overview screen number etc.
    3.create the table maintenance
    4. now go to se93
    5. give custom tcode and say create
    then enter description , and then
    choose the radio button Transaction with parameters
    6. now enter tcode as SM30 and check the check box skip intial screen
    7. Check all gui support buttons
    8. now go down and enter VIEWNAME from F4 help and value as table name
    9. and add UPDATE(choose it from F4) and value as 'X'.
    VIEWNAME ZTABLE
    UPDATE X
    and save it, now check the Tcode.
    or
    use se80...create a transaction...click transaction with parameters and use SM30 as the basis....set VIEWNAME to the table's name and UPDate to X (no quotes)
    If you find it useful mark the points
    ~~Guduri

  • How can i find out what app is using data at 5am

    i have used an unusual amount of data this month.  something on my phone is using data at 5am every morning.  its not me.  how can i find out what it is?

    The times reported for data usage on your bill do not necessarily reflect the time the data was actually used. The system gathers information from the cell sites and reports on a schedule.

  • How can I display a constant 1 hour of data in my VI

    I am currently designing a VI which reads data from a spreadsheet which is being updated from another source.
    I currently have my VI reading the information and displaying it on waveform charts.
    I have 13 sample points each of which has a chart of its own. I wish to plot the data and be able to review it whilst it is running which is not a problem as I have activated the scroll bar function within the chart.
    Now the task I wish to achieve next is to only have a certain amount of history data to review eg 1 hour of data.
    So if I have been running the VI for 8 hours there will still only be the previous 1 hours data to review.
    Can anybody help with how to achieve this? Has anybody else needed to do anything like this?
    Thanks in advance

    Hi n_,
    Would this not keep all of the data plotted stored in memory somewhere?
    That depends on how you created/control those buffers…
    I wish to use this to monitor a process constantly over years
    So you need to limit the history length of your charts or use your own buffers…
    (When it needs to run for "years" you should NOT use a Windows PC and you should stay away from any BuildArray function.)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can I display a avi-file while acquiring data from a DAQ-CARD at the same time

    While my system is acquiring analog data and controlling a motor, I want to display a avi-film (preferably in full-screen, so that the LabView GUI disapears during this process). Are there any VI's to open external players? May I face some problems to lose samples, due to the calling of external players?

    mhi wrote in message news:<[email protected]>...
    > I've already found this example, but it doesn't work with the latest
    > media-player. Anyhow, thank you for your answer!
    you can also try out this free vi from my website:
    http://www.geocities.com/irene_he/FunStuff.html
    Irene

  • How can I test Workflow for Leaves without using ESS

    Hi Gurus,
         Please help me..I need to test my wokflow for leaves but I don't have ESS....How do I do it?
        Thanks in advance for all your help.

    Welcome to the Apple Support Communities
    You didn't install Boot Camp drivers. It looks like you downloaded these drivers > http://support.apple.com/kb/TS3173
    Those drivers are only for the graphic card and Bluetooth, not anything else, so you have to download the Boot Camp drivers on OS X and install them in Windows

  • How can I install drivers for bootcamp without using the mac install dvd?

    I installed windows 7 in bootcamp on my mac. I put the drivers on a FAT format usb stick so they should be installed while the windows installation was running. The most things are working on windows like the i-sight-camera. The problem is that the microphone doesn´t work so I look for a solution for 3 days, no result. Normally, you use the mac install dvd to install the necessary drivers but windows doesn´t want to read the dvd. And yes, you can download the drivers on the apple platform, but that doesn´t help me at all.
    Thanks in advance. (sorry for the language)
    iBasti94

    Welcome to the Apple Support Communities
    You didn't install Boot Camp drivers. It looks like you downloaded these drivers > http://support.apple.com/kb/TS3173
    Those drivers are only for the graphic card and Bluetooth, not anything else, so you have to download the Boot Camp drivers on OS X and install them in Windows

  • How can i display the message

    public class Userdefined extends Exception {
              Userdefined(String sparam){
              System.out.println(sparam);
              Userdefined(){
         private static int acno[]={100,105};
         private static double bal[]={100.00,200.00};
         public static void main(String args[]) {
              try{
              for(int i=0;i<2;i++)
                   System.out.println("ACCCCNO------>"+acno[i]+"BAl------>"+bal);
                   if(bal[i]<150.00)
              Userdefined udexp=new Userdefined("bal less");
              throw udexp;
              catch(Userdefined e){
                   System.out.println("--->"+e);
    How can i display the message "less amt" using my parmeterized constructor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    VinayTK wrote:
    How can i display the message "less amt" using my parmeterized constructor.Erm ... what? You can't --- at least not with the stuff you've got there.
    A properly formed question, with some idea of what you're trying to accomplish would be a huuuuge help.
    Winston
    BTW: Congratulations. At my age, 'first's in computing are rare; but it's definitely the first time I've seen an Exception class with a main() method.
    Edited by: YoungWinston on Sep 1, 2009 9:46 AM

  • How can I display my laptop thru appletv on my hdtv

    How can I display my sony VAIO laptop using APPLETV on my HDTV?

    You have to wait for Mountain Lion - or maybe try out Airparrot.
    Airparrot doesn't support 1080p yet but give it a try.

  • How can i find JKM for "Asynchronous Autolog"

    How can i find JKM for "Asynchronous Autolog" change data capture?

    I do not think there is any. Asynchronous HotLog is supported.
    Best,
    -FX

  • How do I display ethernet connection is being used rather than WI-FI connection in the menu bar/elsewhere?

    I have a new 13" retina MacBook Pro - I have wi-fi connection but also a thunderbolt/ethernet adapter that allows me to connect to my network
    Sometimes, the ethernet connection does not connect and I do not notice for a while (possibly a dodgy TP-LINK plug adapter thingy)
    My question is - how can I display that I am connected/using the ethernet connection rather than the wi-fi? The wi-fi symbol stays in the menu bar but it would be nice to see that I am using the ethernet connection instead
    Many thanks
    Mike

    I don't think you can do that. You can only display the WiFi connection on the menu bar.

  • How to execute a loop for every 15 minutes

    how to execute a loop for every 15 minutes or 30 minutes constantly...

    I need to insert a number into an array for every 15mins continuously..and the array need to hold all datas for example in 0th position i insert a value 10 by 10.00am, after that at 1st position i need to insert 11 by 10.15am, next at 2nd position i need to insert 12 by 10.30am and so on...how this can be done

Maybe you are looking for

  • Issue in Free Goods - I.C(TANN)

    Dear all, I have an issue while creating Free Goods. For the free goods item(TANN), the net price should not be there.when I create an order for Free Goods,net price is there. What is the cause for this? Thanks in Advance Regards Balaji

  • Query problem with multiple date fields.

    I need to select the greatest date from six different fields in each record and identify from which column was selected. date01 date02 date03 date04 date05 date06 010190 010107 010190 010190 010190 010190 010190 010190 010105 010190 010190 010190 010

  • RC1 Jbuilder Plugin

    When configuring the connction properties for the plugin I can't enter a "custom" db dictionary. Only the items in the list can be entered/selected. I tried entering kodo3;kodo.jdbc.DBDictionary=com.marc.kodo3.dict.TeradataDictionary in jbuilders's u

  • Not displaying songs right

    i bought 2 songs on my ipod touch. i plugged my ipod into my computer to edit the song names a little, but when i went back to view it on my touch, it stayed the same. is it not possible to edit song names if u buy songs from ur itouch or something?

  • Telephone dialler GUI and Model questions

    I am creating a telephone dialer and am having a problem working out how to do a couple of things. I need to know how to check that when I add a name and number how i run a check to see if it is already in the array? Also, I can write the code for th