Comparing SQL data in the same table for two different dates

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0
Hello,
We have a batch scheduling tool that automatically runs Oracle jobs and when it runs the jobs it stores a record from the instance in a table. I am trying to write a query that pulls up all of the jobs that ran today and compares them with what ran on the same day last week to find out what jobs didnt run today. So far I have the below but I can't get it to return anything. I am using Toad for this
select *
from xxcar_abat_instances
where trunc(to_date(start_datetime)) = trunc(sysdate-7)
  and completion_status = 'Success'
AND NOT EXISTS
  (select script_name
    from xxcar_abat_instances
   where trunc(to_date(start_datetime)) = trunc(sysdate)
     and completion_status = 'Success')Thank you

Hi,
964188 wrote:
It is a date
Such as
10/31/2012 11:55:03 PMThen, as Hoek says, you don't want TO_DATE. For example:
WHERE   TRUNC (start_datetime) = TRUNC (SYSDATE - 7) or the more efficient
WHERE   start_datetime >= TRUNC (SYSDATE - 7)
AND     start_datetime <  TRUNC (SYSDATE - 6)Also, it doesn't look like the EXISTS sub-query is corelated to the main query. That's almost certainly a mistake.
If you're still having trouble, post your revised query, a little sample data (CREATE TABLE and INSERT statements). Point out where that query is givimg the wrong results, and explain how to get te right results.
See the forum FAQ {message:id=9360002}

Similar Messages

  • Is it possible to use the same Switch for two different clusters.

    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.

    user9198027 wrote:
    I have 10g Rac setup on windows.
    Now I am planning to install 11gR2 on different servers.
    Is it possible to use the same Switch for two different clusters.
    Yes.  Technically there will not be any conflict as long as the private addresses used by the 2 clusters do not collide, and provided that the switch's port capacity and bandwidth will not be exceeded.
    Your NA (netadmin) can also configure the switch to separate the 2 Interconnects from one another (called partitioning when using Infiniband) - if the switch supports such features.
    A major consideration is not to make the switch, public. That typically cause a range of problems and can have a serious impact on an Interconnect. But using 2 private networks on the same infrastructure should not have the same problems - if configured and implemented correctly.

  • Can i load two different itunes on the same computer for two different ipods?

    Can I load two different itunes on my computer for two different ipods?  Or how can I get it so that when I click on itunes, only my songs come up and not my wifes?  And the same for her.

    Yes.  The simplest way is to have separate Windows accounts for each user.  When either user runs iTunes, he/she will have a separate library with distinct content, playlists, etc., and can sync individual iDevices as needed.

  • How can I align two different text row in the same table in two different way (one centered and the other one on the left)?

    Hi,
    I want to center two different text row that are in the same table but one on the center and the other one on the left. I put a <span> tag hoping that it has been overwhelmed the table's class properties The .bottomsel's font-family and the .Cig84's font-family and colour work but the text-align don't: they're both on the left.
    These are my source and CSS codes:
    Source:
    <table width="600" border="0">
      <tr>
        <td class="bottomref"><p><span class="bottomsel">| <a href="index.html" target="_self">Main</a> | <a href="about.html" target="_self">About</a> | <a href="clients.html" target="_self">Clients</a> | <a href="contact.html" target="_self">Contact</a> |</span><br />
          <span class="credits">Credits: <span class="Cig84">Cig84</span></span></p></td>
      </tr>
    </table>
    CSS:
    .bottomsel {
      text-align: center;
      font-family: Georgia, "Times New Roman", Times, serif;
    .credits {
      text-align: left;
    .Cig84 {
      color: #F00;
      font-family: "Comic Sans MS", cursive;

    Use paragraph tags with CSS classes.
    CSS:
         .center {text-align:center}
         .left {text-align:left}
    HTML:
    <table width="600" border="0">
      <tr>
        <td class="bottomref">
              <p class="center">This text is center aligned</p>
              <p class="left">This text is left aligned</p>
        </td>
      </tr>
    </table>
    Nancy O.

  • Service Registry: Publish the same service for two different business syst.

    Hello all,
    i am trying to publish a webservice in the Service Registry of a PI 7.1 EHP1 and i'm facing a problem. I have configured two Business Systems that use the same Service Interface, let's say Dev and Qua systems. So, this two business systems can be senders of the webservice. I have been able to publish the first Sender Agreement properly, but when i try to publish the second Sender Agreement as the service is already publish i get the following error:
    One service definition with the same name 'SI_I015_EneGISDeviceLocationServicesInternalMessage_In(urn:enemalta.com.mt:iubs:integrations)' found; do you want to delete this object from the Services Registry and continue publishing?
    I've been told that this error might be a permission problem but the user i am using has all the permissions required. Does anyone know how to solve this issue?
    Thank you very much in advance!
    Roger Allué i Vall

    Hi Roger,
    Is that problem solved for you?
    I am looking for inputs on a similar issue here. I need to have a single service but with two different endpoints (for two sender business systems) published in SR.
    Thanks,
    Marz

  • Do you set up two itunes accounts on the same computer for two different people

    I have an ipod and my girlfriend has an iphone. We have one computer and when we fire up itunes it always thinks it was the last one that linked. We have different tastes and we do not want to synch the same tracks. How do we set up and migrate between two different itunes ?
    Thanks, Sorry if its a basic question but it is driving us crazy

    How to use multiple iPods, iPads, or iPhones with one computer

  • HT204053 How do I use the same email for two different apple IDs?

    I have inadvertently created two different Apple IDs throughout the years but now need my most recent one to use my email, but still want access to my old apple ID (if I can find it). The old apple ID has priority (the new one is not allowed to verify my email as it is linked to my old ID) with that email - can someone help me have the two IDs linked to the same email?
    Thank you

    AFAIK this is Not Possible. Each ID requires a Unique address
    Apple ID FAQs
    http://support.apple.com/kb/HE37

  • I need to be able to use Thunderbird on the same PC for two different people.

    We have a main desk computer that my Parter and I will be using at different times. Can I create two shortcuts on my screen that let's us access email and calendar tasks?
    I would like us to have our own login for privacy with emails, but be able to share tasks and calendar events if possible.
    So confused on how to do this, any help would be appreciated.
    Thanks

    In short, yes.
    However, I would always advocate having a separate User Account for each user. Modern Operating Systems offer common folders for work that needs to be shared. Do this so you each have your own Windows login, and you can set up a separate Thunderbird profile for each user, and you'll each have your own private workspace too.
    If you really don't want to use the facilities offered by your Operating System for support of multiple users, and prefer to share a login, then it's more complicated. You can use Thunderbird's profile manager to create multiple independent profiles, that is, one each for you and your partner. Then if you open Thunderbird via its profile manager, you can select the appropriate profile.
    https://support.mozilla.org/en-US/kb/using-multiple-profiles?esab=a&s=multiple+profiles+&r=0&as=s
    That's rather clumsy, and I'd want to put in a little more effort and create a link or shortcut for each user that selected the appropriate profile automatically - so this is the "yes" to the question as you posed it.
    Thunderbird doesn't share data between profiles easily. My choice for a shared calendar would be to set one up "in the cloud" and have both Thunderbird profiles subscribe to it. Google Calendar is quite straightforward to set up and use. Other calendars, perhaps provided by your ISP or mail provider may work equally well.

  • How to have two seperate Itunes on the same computer for two Ipods?

    Is there a way to have two separate Itunes downloaded on the same computer for two different Ipods? My sister got a new Ipod and she wants to hook it up to the computer but when ever she does it just pulls up my Itunes and has all of my songs on there. How can we each have our own Itunes?

    There's many ways to accomplish this. You could create two accounts in Windows. That way everything is completely separate. Or, you could manually manage your music in iTunes -- this way it won't automatically sync your music onto her iPod. More info here:
    http://docs.info.apple.com/article.html?artnum=61148
    http://docs.info.apple.com/article.html?artnum=93779

  • TS4147 I have 2 iphones on the same icloud for 2 different users.  We (the users) dont want identical contacts. How do I delete the contats from one phone without deleting them from the other phone.

    I have 2 iphones on the same icloud for 2 different users.  We (the users) dont want identical contacts. How do I delete the contats from one phone without deleting them from the other phone.

    You can't; not if the phones are sharing the same iCloud account.  If you want to keep your data separate, migrate one of them to a different iCloud account.  (You can continue to share the same iTunes ID.)
    To do this, go to Settings>iCloud, tap Delete Account (this won't effect the other phone), choose Keep on My iPhone, sign back in with a different Apple ID to set up a new account, turn on your iCloud data syncing, then choose Merge to upload the data to the new account.  You can then go to icloud.com from your computer and delete the other person's data from each account.
    Another option if you're only concerned about not sharing contacts but wish to share everything else, is to set up a second iCloud account on one of the phones and sync contacts with the secondary account.  To do this, go to Settings>iCloud, turn Contacts to Off and choose Keep on My iPhone.  Then go to Settings>Mail,Contacts, Calendars>Add Account>iCloud, sign in with a different Apple ID to create the secondary account, and turn Contacts to On.  You can then go to icloud.com from your computer and delete the other person's contacts from each account.

  • Use two indicators for the same variable in two different VIs

    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    should I use global variables?? I want to avoid because I have lot of variables and it would takes too much memory,I tried with this code but the value of the second indicator is not updated 
    I tried to use the queue and it works but the problem is as i said previously that i have many variables shoud I use a queue for each one??
    what should I do?
    thank you in advance
    cordialy
    Attachments:
    projet.zip ‏13 KB

    CrisSTine01 wrote:
    hello, I want to use two indicators for the same variable in two different VIs running at the same time
    I'm a huge fan of User Events to send updates to GUIs from who knows where.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do i purchase the same song for a different itunes library on my computer?

    How do I purchase the same song for a different itunes library on the same computer?

    and then they will be sorted in the correct order.

  • Can I use the same iTunes for two iPods

    Hey guys I wanted to ask if it is possible to use the same itunes for two ipods. I have an ipod touch 4g and ipod shuffle. would music be erased if I did  or would their be any problem if I do so. Thanks in advance

    No problems if you do it right. See:
    How to use multiple iPods, iPads, or iPhones with one computer
    What is the best way to manage multiple...: Apple Support Communities

  • Possible solution to avoid deadlock when two inserts happen on same table from two different machines.

    Possible solution to avoid deadlock when two inserts happen on same table from two different machines.
    Below are the details from deadlock trace.
    Deadlock encountered .... Printing deadlock information
    Wait-for graph
    NULL
    Node:1
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x00000013F494A980 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:376 ECID:0 XactLockInfo: 0x000000055014F400
    SPID: 376 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    NULL
    Node:2
    KEY: 8:72057594811318272 (ffffffffffff) CleanCnt:3 Mode:RangeS-S Flags: 0x1
    Grant List 2:
    Owner:0x0000000B3486A780 Mode: RangeS-S Flg:0x40 Ref:0 Life:02000000 SPID:238 ECID:0 XactLockInfo: 0x0000002AA53383F0
    SPID: 238 ECID: 0 Statement Type: INSERT Line #: 70
    Input Buf: RPC Event: Proc [Database Id = 8 Object Id = 89923542]
    Requested by:
    ResType:LockOwner Stype:'OR'Xdes:0x000000055014F3C0 Mode: RangeI-N SPID:376 BatchID:0 ECID:0 TaskProxy:(0x000000080426E538) Value:0x30614e80 Cost:(0/41748)
    NULL
    Victim Resource Owner:
    ResType:LockOwner Stype:'OR'Xdes:0x0000002AA53383B0 Mode: RangeI-N SPID:238 BatchID:0 ECID:0 TaskProxy:(0x00000027669B4538) Value:0x10d8d500 Cost:(0/38828)
    deadlock-list
    deadlock victim=process5daddc8
    process-list
    process id=process5daddc8 taskpriority=0 logused=38828 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994026815 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.347 XDES=0x2aa53383b0 lockMode=RangeI-N schedulerid=43 kpid=14156 status=suspended spid=238 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.463 lastbatchcompleted=2014-07-25T12:46:57.463 clientapp=pa hostname=pa02 hostpid=1596 loginname=myuser isolationlevel=serializable (4) xactid=2994026815 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=mydb.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1] .....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    process id=process5d84988 taskpriority=0 logused=41748 waitresource=KEY: 8:72057594811318272 (ffffffffffff) waittime=2444 ownerId=2994024748 transactionname=user_transaction lasttranstarted=2014-07-25T12:46:57.320 XDES=0x55014f3c0 lockMode=RangeI-N schedulerid=39 kpid=14292 status=suspended spid=376 sbid=0 ecid=0 priority=0 trancount=2 lastbatchstarted=2014-07-25T12:46:57.440 lastbatchcompleted=2014-07-25T12:46:57.440 clientapp=pa hostname=pa01 hostpid=1548 loginname=myuser isolationlevel=serializable (4) xactid=2994024748 currentdb=8 lockTimeout=4294967295 clientoption1=671088672 clientoption2=128056
    executionStack
    frame procname=pa.dbo.SaveBill line=70 stmtstart=6148 stmtend=8060 sqlhandle=0x03000800d61f5c056bd3860170a300000100000000000000
    INSERT INTO [dbo].[Prod1]....
    inputbuf
    Proc [Database Id = 8 Object Id = 89923542]
    resource-list
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5d84988 mode=RangeS-S
    waiter-list
    waiter id=process5daddc8 mode=RangeI-N requestType=convert
    keylock hobtid=72057594811318272 dbid=8 objectname=pa.dbo.prod1 indexname=PK_a id=lock1608ee1380 mode=RangeS-S associatedObjectId=72057594811318272
    owner-list
    owner id=process5daddc8 mode=RangeS-S
    waiter-list
    waiter id=process5d84988 mode=RangeI-N requestType=convert

    Don't know. Perhaps these can help. I scanned the second link but didn't see much about Ending Deadlocks. I'd say the Fourth link probably has better information than the first three links. But maybe read them all just in case the Fourth is missing something
    one of the first three have.
    Deadlocking
    Detecting and Ending Deadlocks
    Minimizing Deadlocks
    Handling Deadlocks in SQL Server
    Google search for "SQL Deadlock"
    La vida loca

  • How to use same DFF for two different forms with :BLOCK.field reference

    Hi,
    Can anyone suggest how to use the same dff in two different forms by using :BLOCK.field reference.
    Scenario is the same DFF is referenced by two forms, viz. Form-1 & Form-2.
    Form-1 Reference Field is :BLOCK.field name, but the same block is not available in Form-2, which throws an error while opening it.
    Any pointers please.
    Thanks,

    In the environment I currently have access to do not have similar setup.
    Let say you setup the DFF1 default value to $HEADER.customer_name, the name of the DFF is CUSTOMER_NAME, description can be anything.
    In DFF2, default value should be a SQL, where you can reference the DFF1. For example, SELECT DECODE($FLEX.CUSTOMER_NAME, 'ABC', 1, 'DEF', 2, NULL) FROM dual
    In this case, you can reference the DFF1.

Maybe you are looking for

  • End of contract questions (Unlimited data+4G)

    I currently have 2 lines in my account. The main line is mine and the contract is up on 11/.07, while the secondary line is 12/04. I have been waiting for the new gen 4G and Galaxy Nexus to be announced before making a decision on what to upgrade my

  • F111 and payment method field 'payment orders only' deactivated T042ZL-XNOP

    Hi F111 gives an error for a payment method: "Creation of payment orders is not supported. Message no. PZ588. Diagnosis Payment method B is configured so that a payment order is created. This function is not supported in the payment program for payme

  • I can't work out how to transfer my photos and what not from my iPhone 4 to my iPhone6 via iCloud

    I've recently purchased an iphone 6 and am trying to transfer all my photos and documents from my iphone 4 to my iphone 6 via iCloud. However I can't seem to work out how to do it. Please someone help!

  • In iMovie 11 I can not add photos after the first video.

    I keep trying to add a photo taken with my iPhone to a project, but it never shows up.  Instead of showing up the video immediately previous to the photo displays a still shot with Ken Burns.  Any thoughts?

  • Java Signals

    I'm posting this here because I do not know of a better way to address the Java development team directly. Requests for a signal handling facility have been made since the earliest releases of Java. The response from the Java development team seems t