At this Point in time

Dear Friends
In my logic day starts at 4 AM so needed a query to compare today's performance with yesterday's performance at until this point of time
Column1 - weight_date ' this is the column in which date and time is recorded
Column2 - weight ' this column contains the weight
So need a query which will count the weight from yesterday morning 4 till yesterday same time as today
select sum(weight) from weight_slip where weight_date > yesterday 4 am and weight_date <= yesterday date and today's time
So if the time now is 5 pm i would fetch the weight from morning 4 am yesterday  till 5 pm yesterday

Hi,
Since the calendar day begins 4 hours ( or 4/24 of a day) before your business day, you'll need to subtract 4/24 from the calendar day to get your business day.
This should do what you requested:
WITH     got_adj_dates     AS
     SELECT     weight_date -    (4 / 24)     AS adj_weight_date
     ,     weight
     ,     TRUNC (SYSDATE - (4 / 24)     AS today
     FROM     weight_slip
     WHERE     weight_date     BETWEEN     TRUNC (SYSDATE - (4 / 24)) - (20 / 24)
                    AND     SYSDATE - 1
     OR     wieght_date     BETWEEN     TRUNC (SYSDATE - (4 / 24)) + ( 4 / 24)
                    AND     SYSDATE
SELECT     SUM (CASE  WHEN adj_weight_date <  today  THEN weight  END)     AS total_yesterday
,     SUM (CASE  WHEN adj_weight_date >= today  THEN weight  END)     AS total_today
FROM     got_adj_dates
;If you'd care to post a little sample data (CREATE TABLE and INSERT statements), and the results you want from that data, then I could test this.

Similar Messages

  • Need help with Backup Recovery using Rman - Point in Time.

    Hi all,
    I am trying to recover my database to a certain point in time. Here are the details below.
    Oracle database version is. 11G R1. on 2 Node RAC. OS is AIX.
    Database name is Sales.
    Due to a mistake by the Application team, the database is written over by bad data. Now I have to restore the database in to a point in time, where the database was good.
    For this, i took a whole (full) RMAN backup, everything, all the archivelog files and Controlfiles as well.
    After doing this, i dropped the entire database. So now everything is clean.
    Now i have to restore and recover the database to this point in time.. 03/16/2011 12:45:00
    Please guide.
    The backups are located at.. /backup/sales/rman/
    I am trying various things, but each time i get the msg..
    ORA-01507: database not mounted
    I understand.. the reason for this message is the controlfile does not exist.. as the database is in mount mode. But as i said.. i have dropped the database in order to proceed with entire restoration.
    But i have taken a whole backup.. which also includes the controlfiles + archivefiles.
    Please guide.. with proper steps and commands.

    Hi,
    Priror to start with restore and recovery - Try to restore the control file from backups "/backup/sales/rman/"
    Then further you can mount the db and further carry on with recovery (catalog the backups prior to recovery)
    - Pavan Kumar N

  • IPhone stuck on connect to iTunes screen do not use iTunes or have it installed on my PCs; does anyone know of an easy fix other than updating windows then installing iTunes?  I don't have time to go through the process again and at this point will d

    Hi all- I'm new to this online community of Apple support; my iPhone 5s is stuck on a screen that has the connect to iTunes icon, this started after I upgraded to IOS 8.1.1 from the beta to fixed version; I don't use iTunes and have an IPad, home PC, office PC, and Galaxy Tab, and I went through (failed) the process of installing itunes on my office PC but needed to update windows; after going through all redommendations I could find, including Apple phone support, I still haven't had success.  Does anyone know a way to get my phone past that screen?  I don't have time to keep doing updates and installation attempts;'I don't care about the content at this point; but I can't get to the settings to "reset all" and start from scratch; I bought i loud for storage and have an old 4s that has a broken screen butt still works and I have another active 4s on my plaN.  Im not tech savvy myself; but I know some community members are pure geniuses! !I just need a fast way to fix this bug;'I use it for work and it's been inaccessible all week, the only time I have to go to an Apple Store is this weekend; I don't want to move to the iphone6 because it's too big.  I didn't know this community existed; it's cool; for this issue, I just have no time for a new phone or phone support again; I'm posting this question as a last resort; any feedback is appreciated......and I apolo in advance if this post goes under the wrong thread

    No. You have no alternative but to plug it into a computer running iTunes and restore it.

  • I HATE my new MACBOOK PRO, it will not let me open any PDF files and I downloaded the ADOBE READER three freaking times and it keeps saying that all the files are corrupt. I would rather have my 2008 Dell at this point. what is wrong with this thing

    I HATE my new MACBOOK PRO, it will not let me open any PDF files and I downloaded the ADOBE READER three freaking times and it keeps saying that all the files are corrupt or damaged. I would rather have my 2008 Dell at this point. what is wrong with this thing

    Perhaps the PDF files are corrupted.
    Hit the command key and spacebar, a blue Spotlight in the upper right hand corner appears, now type Preview and press return on the Preview program.
    Now you can try opening the PDF's from the file menu and see what's going on.
    If they are corrupted, perhaps they are trojans from your Windows PC or gotten from a bad location online.
    Download the free ClamXav and run a scan on the possibly infected folder.

  • I updated ipad 4.3 to io7 but now when I go to set up it keeps asking me to restore - I have done this from itunes several times but it still gets stuck at this point in set up - help!

    I updated ipad 4.3 to io7 but now when I go to set up it keeps asking me to restore - I have done this from itunes several times but it still gets stuck at this point in set up - help!

    All media and apps should be in iTunes on the computer.  Simply select the content desired to sync to the device and sync it.
    FYI, backups have never included media or apps.
    Downloading past purchases from iTunes

  • If I have forgotten my security questions and am not given the option to send them to an alternate email address because I didn't have one set up at the time, how can I get passed this point? I'm sure I'm blocked out at this time from trying.

    I cannot remember my security questions and I am not given the option to send to an alternate email address because I didn't have one set up at the time.  How can I get past this point?

    See Here... ask to speak with the Account Security Team...
    Apple ID: Contacting Apple for help with Apple ID account security
    Or Here  >  Apple  Support  iTunes Store  Contact

  • Firefox 4 takes a long time to startup at this point i am thinking about going back to internet explorer as my default browser. what is going on??

    firefox 4 takes a long time to startup at this point i am thinking about going back to internet explorer as my default browser. what is going on??

    Click the Firefox button, go to Add-ons, then Plugins and disable "'''My Web Search'''". This is adware which runs in the background and spends its time trawling the web searching for ads to feed you.
    Also, something shows in your system details with the number '''2,5,3,1 '''. Can you tell me what that is please? It's located in the same Plugins menu.
    Similarly, I see three versions of Veetle. Disable the older ones if you don't need them.
    On the security side, your Flash player is out of date and exposes your system to exploits. See: http://www.adobe.com/support/security/bulletins/apsb11-12.html (Update link near the foot of the page).
    If the problem persists, try running Firefox in [[Safe Mode]]. If it functions properly in that configuration, then one of your add-ons is the culprit.

  • I have a power mac G5.  It boots up fine and then a screen comes down and in a bunch of different languages tells me the machine needs to be restarted. At this point everything is frozen. I have done this a number of times and I get the same thing.

    I have a power mac G5.  It boots up fine and then a screen comes down and in a bunch of different languages tells me the machine needs to be restarted. At this point everything is frozen. I have started the machine up a number of times and I get the same thing.  Anyone have any ideas?

    Does it boot from the Install Disc OK?
    Does it boot into any of these modes?
    Holding Option/alt key at bootup.
    Holding SHIFT key at bootup.
    Target mode...
    http://support.apple.com/kb/HT1661
    Does it boot to Single User Mode, CMD+s keys at bootup, if so try...
    /sbin/fsck -fy
    Repeat until it shows no errors fixed.
    (Space between fsck AND -fy important).
    Resolve startup issues and perform disk maintenance with Disk Utility and fsck...
    http://docs.info.apple.com/article.html?artnum=106214
    We might get clues with verbose mode...
    http://support.apple.com/kb/HT1492

  • Point in time snapshot

    Hi,
    I'm very new to Oracle and this is my first post so if I miss anything important, please excuse my ignorance...
    We have a Oracle 10g datawarehouse which contains service desk data on tickets, agent performance etc.
    I'm specifically trying to obtain a count of tickets that were in an active status and were sat with a certain group at a certain point in time.
    The table TICKETS contains the usual ticket data, ticketnumber, open date, close date etc and the refgroup field which indicates current group ownership.
    The select statement below works for all tickets currently owned by Group1 that were active (not closed) at 00:00:00 on Monday but doesn't take into account changes in group ownership so a ticket could be counted by the statement on first run but if the group changes, it will not be included.
    We have a table which records SLA events for each ticket such as (but not only) group transfers and the date each transfer took place and this table is linked from the TICKETS table via a ticket ID field in each.
    Each row in this table has a GroupName value to show the group responsible for each event, as in the below example.
    If for example the snapshot date is 13/07/09 00:00:00, is there a way to calculate from the SLA events records as below, whether Ticket1 fits this criteria?
    This is basically an expression field in Crystal Reports so I can work with either a field that returns a 1 or 0 at the ticket level and then count within the app, or a field that returns a total count of all tickets that fit this criteria.
    Thanks alot in advance.
    Andy.
    TicketNumber GroupName EventDateTime
    Ticket1 Group1 09/07/09 08:43:21
    Ticket1 Group1 09/07/09 14:28:35
    Ticket1 Group2 14/07/09 13:12:10
    SELECT
    COUNT(TICKETNUMBER)
    FROM
    "ORGANIZATION"
    INNER JOIN "TICKETS"
    ON "ORGANIZATION"."ORG_ID" = "TICKETS"."ORGANISATION_FK"
    WHERE
    "ORGANIZATION"."ORG_NAME" = 'Org1'
    AND "TICKETS"."REFGROUP" = 'Group1'
    AND
    "TICKETS"."OPEN_DATE" < LEAST(TRUNC(SYSDATE),TRUNC(SYSDATE,'IW'))
    AND "TICKETS"."CLOSE_DATE" > LEAST(TRUNC(SYSDATE),TRUNC(SYSDATE,'IW'))
    OR
    "TICKETS"."OPEN_DATE" < LEAST(TRUNC(SYSDATE),TRUNC(SYSDATE,'IW'))
    AND "TICKETS"."STATUS" <> 'Closed'
    )

    Hi,
    user11696977 wrote:
    Thanks again Frank.
    Looking at the doc you linked I think this query should do what I'm after but running it gives me an insufficient priviledges error.In case you're wondering what privileges are ineeded, under "SELECT - Prerequisites" the [SQL Language manual|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2065699] says:
    "To issue an Oracle Flashback Query using the flashback_query_clause, you must have the SELECT privilege on the objects in the select list. In addition, either you must have FLASHBACK object privilege on the objects in the select list, or you must have FLASHBACK ANY TABLE system privilege."
    Will have to see how this goes if I can get priviledges assigned to the account I'm using.
    SELECT
    COUNT(TICKETNUMBER)
    FROM
    "ORGANIZATION"
    AS OF TIMESTAMP LEAST(TRUNC(SYSDATE),TRUNC(SYSDATE,'IW'))
    INNER JOIN "TICKETS"
    ON "ORGANIZATION"."ORG_ID" = "TICKETS"."ORGANISATION_FK"
    WHERE
    "ORGANIZATION"."ORG_NAME" = 'Org1'
    AND "TICKETS"."REFGROUP" = 'Group1'
    AND "TICKETS"."STATUS" <> 'Closed'
    Looks good.
    This will join the organization table as it exsited at 00:00 on Monday to the tickets table as it exists at run-time.
    TRUNC (dt, x) is never later than dt, so you can just say
    AS OF TIMESTAMP TRUNC(SYSDATE, 'IW')

  • Balance Sheet translation at spot rate at ANY point in time

    My client produces its financial accounts in AUD.  They will have open items in AR, AP and Bank in foreign currencies.  WITHOUT running periodic valuation they wish to produce a Balance Sheet at any point in time during the month applying the applicable daily spot rate to valuate the Foreign Currency open items (for reporting purposes only).  I have run S_ALR_87012284 and maintained the special evaluations tab for Display Currency (AUD), Key date for translation (current date) and exchange rate type (spot rate type).  However, this does not appear to be revaluating the open items in the subledger accounts to produce the balance sheet at the current spot rate.  Appreciate input / alternate approach.  Cheers, Dean.

    Hi Chirag
    As per Oracle following are the rules that has to be followed for translation.
    1. For Balance Sheet Accounts (Asset & Liabilities) GL as a default uses the YTD rule.
    2. For P&L Accounts you can choose between YTD and PTD rule. So in your case you can use the default PTD Rule. (Profile Option 'GL Translation: Revenue/Expense Translation Rule')
    YTD Rule = (Translated Period Amount = Period-End Rate x YTD Ledger Currency Balance - Beginning Translated Balance).
    PTD Rule = (Translated Period Amount = Period Average Rate x PTD Ledger Currency Balance)
    Hope this helps.
    Regards,
    Gautam
    Edited by: Gahlout on Sep 25, 2012 11:04 PM

  • HT4325 Will there be a point in time when I can multiple speaker play to my Air devices, and my AppleTvs?  Or do I need redundant Air @ the tv too?

    Background
    I drank the coolaid and have a MacMini command center along with all my PC's and Wifi and this and that.
    I have a few Airport expresses in random locations.. bathroom.. kitchen... I also have an Apple Tv in the fam room, and bedroom.
    From the Mac I see I can play songs in iTunes, click Multiple speakers, and choose all my AirExpress devices.  However I cannot also mutiple to the AppleTvs.  Of course I can AirPlay to a single tv, or a single AirExpress. 
    Question
    Will there be a point in time where I can choose 'Multiple Speaker', and select all my home AirExpress class devices, and the AppleTv devices?
    Current Infrastucture --- Will easily support my ambient musical desires.
         Mac Mini 2012, running 10.8.
         AirPort Expresses, newest generation.    
         AppleTv 3's, 5.1 not the developer 5.1+ yet.
         Whole house each floor and exterior, one SSID wifi network, multiple bands, (cisco e3000)'s running dd-wrt with a backend WDU.
         Multiple Linksys (SRW208P)'s wired switching fabric, 802.1q and all that jazz.

    Ok looks like the latest updates made this possible.

  • Structuring a Business Area for Reporting Periods and Points in Time

    Dear all,
    I'm in the process of designing my first business area for discoverer.
    The database is for people staying in accommodation over various periods.
    (Anything from individual days to periods of 15 years!!)
    The reports I'm producing fall into two categories:
    (a) Reports on periods of time such as:
    Accomodation days during a year broken down by Region
    Trend of accommodation days per month during a two year period
    (b) Reports on a particular point in time such as:
    Number of people in accommodation on a particular day
    I'm trying to work out how to structure the business area.
    If I think about requirement (a), I'm inclined to create a view which
    splits up periods into one month chunks (the smallest period I think I need).
    By this I mean having a view which gives me a row for every month for which any period of accommodation is active. This makes reporting on a monthly basis fairly easy.
    If I think about (b), I'm inclined to create a view which leaves the accommodation periods as single rows and then calculate a boolean field which indicates whether that accomodation is active on the date in question.
    It seems that these two requirements need different structures in the business area. Maybe it's best to create two folders which draw on the two different views.
    Any thought would be appreciated.
    Regards
    Suhada

    Hi,
    As you would probably expect, it all depends on your requirement and the table design.
    You can create a date hierarchy in Discoverer that contains the day, month, year levels and this will make it easy to create reports with totals aggregated at these levels.
    However, if your table contains, for example, the start and end dates when people move in and out of accommodation, then you will need to have a period table so that you can report on the months between the start and end dates. The period table will list all past and future months and you can join this to your data to obtain totals for all the periods.
    If you need to have reports that display zeros or nulls for periods where there is no data, then you will need to outer join your data with a period table.
    The decision on whether to use views or folders and joins in the EUL depends on the complexity of your data model. If you need to join many tables together to produce a single report, then you should consider putting some or all the joins into database views.
    Hope that helps,
    Rod West

  • I have been trying to install Itunes for 3 days to my computer.  MY eyes burn and I want to smash this computer at this point!!!! HELP ME!!! I receive this message when I run the diagnostic on my iphone Microsoft Windows Vista Ultimate Edition (Build 6000

    I have been trying to install Itunes for 3 days to my computer.  MY eyes burn and I want to smash this computer at this point!!!! HELP ME!!! I receive this message when I run the diagnostic on my iphone
    Microsoft Windows Vista Ultimate Edition (Build 6000)
    Dell Inc. Studio 1535
    iTunes 10.6.1.7
    QuickTime not available
    FairPlay 1.14.37
    Apple Application Support 2.1.7
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.5.502
    Gracenote MusicID 1.9.5.115
    Gracenote Submit 1.9.5.143
    Gracenote DSP 1.9.5.45
    iTunes Serial Number 0020AEDC02A7C4B8
    Current user is an administrator.
    The current local date and time is 2012-04-17 17:05:40.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name:          {92497F93-8A79-419C-AA27-50CD2F263F77}
    Description:          Microsoft Virtual WiFi Miniport Adapter
    IP Address:          0.0.0.0
    Subnet Mask:          0.0.0.0
    Default Gateway:          0.0.0.0
    DHCP Enabled:          Yes
    DHCP Server:
    Lease Obtained:          Wed Dec 31 19:00:00 1969
    Lease Expires:          Wed Dec 31 19:00:00 1969
    DNS Servers:
    Adapter Name:          {6FECCC1D-04CF-4A3F-92B6-DC6E68D12BE5}
    Description:          Dell Wireless 1397 WLAN Mini-Card
    IP Address:          192.168.0.118
    Subnet Mask:          255.255.255.0
    Default Gateway:          192.168.0.1
    DHCP Enabled:          Yes
    DHCP Server:          192.168.0.1
    Lease Obtained:          Tue Apr 17 16:59:28 2012
    Lease Expires:          Wed Apr 18 16:59:28 2012
    DNS Servers:          192.168.20.254
                        192.168.30.217
    Adapter Name:          {3323A300-E864-46C3-A6B6-F0B90AFF4AFE}
    Description:          Broadcom NetLink (TM) Gigabit Ethernet
    IP Address:          0.0.0.0
    Subnet Mask:          0.0.0.0
    Default Gateway:          0.0.0.0
    DHCP Enabled:          Yes
    DHCP Server:
    Lease Obtained:          Wed Dec 31 19:00:00 1969
    Lease Expires:          Wed Dec 31 19:00:00 1969
    DNS Servers:
    Active Connection:          LAN Connection
    Connected:          Yes
    Online:                    Yes
    Using Modem:          No
    Using LAN:          Yes
    Using Proxy:          No
    Firewall Information
    Windows Firewall is on.
    iTunes is NOT enabled in Windows Firewall.
    Connection attempt to Apple web site was unsuccessful.
    The network connection timed out.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was unsuccessful.
    The network connection timed out.
    Connection attempt to Gracenote server was successful.
    Last successful iTunes Store access was 2012-04-17 17:04:26.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.0.1),
    E: Optiarc DVD+-RW AD-7640S, Rev HD14
    Drive is empty.
    **** Device Connectivity Tests ****
    iPodService 10.6.1.7 is currently running.
    iTunesHelper 10.6.1.7 is currently running.
    Apple Mobile Device Service not found.
    Universal Serial Bus Controllers:
    Intel(R) ICH8 Family USB Universal Host Controller - 2830.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2831.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2832.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2834.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2835.  Device is working properly.
    Intel(R) ICH8 Family USB2 Enhanced Host Controller - 2836.  Device is working properly.
    Intel(R) ICH8 Family USB2 Enhanced Host Controller - 283A.  Device is working properly.
    FireWire (IEEE 1394) Host Controllers:
    Ricoh 1394 OHCI Compliant Host Controller.  Device is working properly.
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.

    This should get your itunes store connection working.
    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 & above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • How to find all those list of SAP standard and custom objects that are changed from a specific point of time

    Hi all,
    Please let me know the process to track or find all the SAP Standard and custom objects. that got changed from a specific point of time.
    Is there any function module or any table where this change log is maintained.?
    I just only need the details ,wheather that SAP standard or Custom object has got changed or not.
    Thanks in advance

    Hi RK v ,
    I really don't know what your actual requirement is , but if you want to know the objects as per the modification , then transport request will be much help to you .
    Have a look into table E070 and E071 .
    Regards ,
    Yogendra Bhaskar

  • Long story short....I restored my computer to an earlier point using time machine and now all of the previous back-ups are gone. My question has to do with itunes...is it possible to restore my itunes library to the most recent backup because the restore

    Long story short....I restored my computer to an earlier point using time machine and now all of the previous back-ups are gone. My question has to do with itunes...is it possible to restore my itunes library to the most recent backup because the restore that I did was in march and the latest backup was in may....the reason being is that there were app that i had downloaded that are in my most recent back-up, that were not in the backup I restored to. Is it possible to just restore one application ie)itunes?

    See this post.
    tt2

Maybe you are looking for

  • OBIEE 11g error in filter

    Hi, I have a problem in OBIEE 11.1.1.6 I have a report where project No is a filter i.e in where condition. Now I have a project no like "ERP-HR STD&2012". Now this is not returning data getting error out. In OBIEE, whenever it see any & sign in the

  • Problem when loggin in abroad

    Hello I need to be able to access my account online both from the US and abroad (Italy mainly). Currently when I try to access my account online abroad I keep getting an error message after I input my userid. I am never able to reach the page that as

  • Function Modules for Format Date, Month Name and Quarter value.

    Hi All, 1. I am getting the date field from the Flatfile, so i need to format the date to YYYYMMDD. Is there any Function module for that in BW. 2. Based on the above Formated Date i have to find out the Name of the Month like JANUARY, FEBUARY etc. 3

  • Error in Generation SID

    Hi gurus... In the z object error message comesup. "Value in SID table is 000000000087660001; correct value is 000000000087660001; SID in SID table is 169947"...How to correct this error Thanks in advance

  • Is there a way to disable the new VIP mail folder?

    It's of no use to me and I do not wish to see it amongst my email accounts