12 months AGO date

i have a ccan_dt(connection cancellation date) for every agent
i am trying to calculate the amount the agents spend before 12 months of connection cancellation date ie ccan_dt
agent ccandt
a 14/8/2009
b 12/7/2003
c 08/10/2000
d 7/8/1999
select sum(spend),agent from spendmas where spenddt between d1 and d2 group by agent
in the above d2 is the ccan_dt of each agent and d1 is 12 before date of d2
can any one suggest the efficinet way of acheving this.
i did this by creating a temp table to hold the dates and then calculated the spend.
but how can i achevie this with out creating a temp table.
is there any regular expression which can get 12 months ago date as in OBIEE.
please advice..

user633377 wrote:
select sum(spend),agent from spendmas where spenddt between d1 and d2 group by agent
in the above d2 is the ccan_dt of each agent and d1 is 12 before date of d2
can any one suggest the efficinet way of acheving this.
i did this by creating a temp table to hold the dates and then calculated the spend.
but how can i achevie this with out creating a temp table.
is there any regular expression which can get 12 months ago date as in OBIEE.
please advice..Didn't quiet understand the need for a temp table.
However you can get a date from 12 months before by using ADD_MONTHS Function.
Something like:
SQL> SELECT SYSDATE FROM Dual
  2  /
SYSDATE
20-AUG-09
1 row selected.
SQL> SELECT ADD_MONTHS(sysdate, -12) FROM Dual
  2  /
ADD_MONTH
20-AUG-08
1 row selected.
SQL>So your query might be changed to
  SELECT   SUM (spend), agent
    FROM   spendmas
   WHERE   spenddt BETWEEN d2 AND ADD_MONTHS (d2, -12)
GROUP BY   agentAssumed d2 is cancellation date
Hope this helps.
Regards,
Jo

Similar Messages

  • My macpro buckled and broke up a year ago. A month ago got wet and I dried it near a heater. It froze and the mouse can not click the connection through. After three weeks I plugged in readjusted the date and it worked for about 20 minutes.. any idea?

    My laptop macbook pro fell with me out of a truck and buckled last June 2012. It still worked although bent and open. A month ago it got wet and stop working and I dried it near a heater and it worked. The battery is dead. Then it froze on the screen the mouse can not grab the attention of the screen when it clicks. The track pad no longer responds and has buckled more. Then after three weeks of not touching it I plugged it in reset the date and connected and it worked. I began to back up my material and then it froze again.

    Though the MBP may be disfigured, there is a real possibility that the HDD is still functional.  Take it out of the MBP and place it in an enclosure and connect it to another Mac.  You may be able to recover all of your data.
    Ciao.

  • I restored my phone but it restored to the only back up i had which was 2 months ago. Now none of the settings i have are up to date on what i had. How do i get all the text messages from that backup up to today?

    I tried to update my phone, but it died so i had to restore it. The only back up i had was from 2 months ago. How do i get all the settings back from that huge gap of me not syncing it?

    Please read before going through with this procedure.
    If you really want your contact back and you did not do another iCloud backap since you deleted some of your contacts, you can do a hard reboot on both devices with iClouded contacts by holding down the home and lock buttons on each of them for 10 seconds ignoring the slide to turn off thing. Make sure you have iCloud contact services off before doing so. You can then go through the whole set up process until you get up to the backup part. You then press to restore from an iCloud backup (make sure you choose the right backup for the right phone). If you didn't make an iCloud backup before the contact incident, you will have to use your two-month-old iTunes backups. Each phone should have their contacts the way they were from your last backup. You then go into Settings>iCloud>and turn off contacts. You then can choose if you want to keep your current contacts or not. Turn this off on both phones just incase you add another iCloud device to the mix later on. Now your contact lists are no longer linked (Caution: side effect may include lack of edit button). You may now add and delete contacts as you please without it happening on your other phone.
    Thank you for choosing Apple.

  • When I purchased my Mac six months ago, I transferred my Quicken data to Quicken Essentials which has worked well for me until yesterday.  Now Quicken Essentials will not open the data file.  What happened?  How do I get back in?

    When I purchased my Mac six months ago, I transferred my Quicken files to Quicken Essentials.  That worked fine until yesterday.  Now I'm getting messages that there is not application to open the files, or that it just plain can't open the file.  What gives here?  What happened?  How can I get back in?

    Launch the Quicken application and try to open the file from there, if you haven't already. If that fails, and a simple restart of the computer doesn't help, try reinstalling the application. If that doesn't cure the problem, I would suggest you take this up in the Quicken Community:
    https://qlc.intuit.com/app/full_page
    or with Quicken support:
    https://quicken.custhelp.com/app/contact/plvl1/win
    You'll be most likely to get further help with your issue there.
    Regards.

  • FF keeps freezing. this started 3 months ago (there have been 2 updates since the update when it started) tried all solutions in forum

    FF now freezes almost every time I click a button on any website -- it worked fine until about 3 months ago. This usually resolves itself without any warnings, but sometimes get unresponsive script or plug-in (flash) warning. But it's usually quicker just to re-start FF, which usually helps. Almost every morning I get on the computer, I have an unresponsive script warning (this is usually chrome://global/content/bonding/browser). I've read forum articles, shut off hardware accelerator, use ad, script, flash blockers. However, some of my add-ons won't load -- the ones that need FF to be re-loaded. I've done this repeatedly and ad blocker, etc. won't load -- they worked before I reset FF, which I tried because nothing else was solving my freezing problem. I followed a thread to get add-ons to load and I deleted files in my profile but this didn't solve that problem (though No SCript loaded when I restarted my COMPUTER -- the others did not). Lastly, that thread was closed because the asker's problem was solved, while mine, the SAME problem, was not. This is my troubleshooting information:
    Application Basics
    Name: Firefox Version: 30.0 User Agent: Mozilla/5.0 (Windows NT 5.1; rv:30.0) Gecko/20100101 Firefox/30.0
    Crash Reports for the Last 3 Days
    All Crash Reports (including 5 pending crashes in the given time range)
    Extensions
    Name: Clean Links Version: 2.6.0 Enabled: true ID: {158d7cb3-7039-4a75-8e0b-3bd0a464edd2}
    Name: Erase Facebook ads and suggestions Version: 1.1.1.0 Enabled: true ID: jid1-UfSghNz6VhKecw@jetpack
    Name: NO Google Analytics Version: 0.6 Enabled: true ID: jid1-JcGokIiQyjoBAQ@jetpack
    Name: Video Blocker Version: 1.0.0 Enabled: true ID: jid1-3OQ5HY7YsLBV7Q@jetpack
    Name: Adblock Plus Pop-up Addon Version: 0.9.2 Enabled: false ID: [email protected]
    Name: Disconnect Version: 3.14.0 Enabled: false ID: [email protected]
    Name: Flash Control Version: 1.0.5 Enabled: false ID: jid1-sNL73VCI4UB0Fw@jetpack
    Name: Microsoft .NET Framework Assistant Version: 0.0.0 Enabled: false ID: {20a82645-c095-46ed-80e3-08825760534b}
    Name: NoScript Version: 2.6.8.28 Enabled: false ID: {73a6fe31-595d-460b-a920-fcc0f8843232}
    Name: Skype Click to Call Version: 6.11.0.13348 Enabled: false ID: {82AF8DCA-6DE9-405D-BD5E-43525BDAD38A}
    Name: Updated Ad Blocker for Firefox 11+ Version: 0.7.7 Enabled: false ID: {4DC70064-89E2-4a55-8FC6-E8CDEAE3618C}
    Important Modified Preferences
    accessibility.blockautorefresh: true accessibility.typeaheadfind: true browser.cache.disk.capacity: 358400 browser.cache.disk.smart_size_cached_value: 358400 browser.cache.disk.smart_size.first_run: false browser.cache.disk.smart_size.use_old_max: false browser.link.open_newwindow: 2 browser.places.smartBookmarksVersion: 7 browser.sessionstore.upgradeBackup.latestBuildID: 20140605174243 browser.startup.homepage: http://www.wikipedia.org/ browser.startup.homepage_override.buildID: 20140605174243 browser.startup.homepage_override.mstone: 30.0 browser.tabs.loadInBackground: false dom.mozApps.used: true extensions.lastAppVersion: 30.0 gfx.blacklist.direct2d: 3 gfx.blacklist.layers.direct3d10: 3 gfx.blacklist.layers.direct3d10-1: 3 gfx.blacklist.layers.direct3d9: 3 gfx.blacklist.layers.opengl: 3 gfx.blacklist.stagefright: 3 gfx.blacklist.suggested-driver-version: 6.1400.1000.5218 gfx.blacklist.webgl.angle: 3 gfx.blacklist.webgl.msaa: 3 gfx.blacklist.webgl.opengl: 3 gfx.direct2d.disabled: true layers.acceleration.disabled: true network.cookie.prefsMigrated: true places.database.lastMaintenance: 1403210052 places.history.expiration.transient_current_max_pages: 26584 plugin.disable_full_page_plugin_for_types: application/pdf plugin.importedState: true privacy.donottrackheader.enabled: true privacy.sanitize.migrateFx3Prefs: true storage.vacuum.last.index: 0 storage.vacuum.last.places.sqlite: 1403118175
    Graphics
    Adapter Description: Intel(R) 82915G/GV/910GL Express Chipset Family Adapter Drivers: ialmrnt5 Adapter RAM: Unknown Device ID: 0x2582 Direct2D Enabled: Blocked for your graphics driver version. Try updating your graphics driver to version 6.1400.1000.5218 or newer. DirectWrite Enabled: false (0.0.0.0) Driver Date: 1-23-2005 Driver Version: 6.14.10.4020 GPU #2 Active: false GPU Accelerated Windows: 0/13 Basic Blocked for your graphics driver version. Try updating your graphics driver to version 6.1400.1000.5218 or newer. Vendor ID: 0x8086 WebGL Renderer: Blocked for your graphics driver version. Try updating your graphics driver to version 6.1400.1000.5218 or newer. windowLayerManagerRemote: false AzureCanvasBackend: skia AzureContentBackend: cairo AzureFallbackCanvasBackend: cairo AzureSkiaAccelerated: 0
    JavaScript
    Incremental GC: true
    Accessibility
    Activated: false Prevent Accessibility: 0
    Library Versions
    NSPR Expected minimum version: 4.10.6 Version in use: 4.10.6
    NSS Expected minimum version: 3.16 Basic ECC Version in use: 3.16 Basic ECC
    NSSSMIME Expected minimum version: 3.16 Basic ECC Version in use: 3.16 Basic ECC
    NSSSSL Expected minimum version: 3.16 Basic ECC Version in use: 3.16 Basic ECC
    NSSUTIL Expected minimum version: 3.16 Version in use: 3.16

    I turned off the accelrator months ago. That was the first thing I did. It helped some. The problem is getting progressively worse, so it seems like every upgrade in the past 3-4 months is causing the problem.

  • When I am using Premiere elements 13 I get a message that pops up "that there is no disk in the drive. Please insert a disk into drive", this also happened 3 months ago How can I get rid of this again?

    When I am using Premiere Elements 13 I get a message that pops up "There is no disk in the drive" I click on it and it keeps coming back "very annoying", but about three months ago it happened to me and I was told to change the file name from OldFilm.AEX  to OldFilm.AEXold. Well now the file is back in Folder OldFilm.AEX. Here is a screen shot the files are highlighted.What should I do now to correct this once and for all, or can I? Thank you for your time.

    TomWolves
    I would do another rename to disable or just delete all the OldFilm.AEX and OldFilm.AEXOLD in that NewBlue Folder.
    If you do, please let me know if that OldFilm.AEX regenerates itself the next time you open Premiere Elements 13.
    Here is the strange story...at least from my Premiere Elements 13 Windows perspective...never had the No Disc error issue
    Here are some details to sort through trying to figure out why you have 2 OldFilm.AEX file in the NewBlue Folder.
    1. The original OldFilm.AEX file of Premiere Elements 13 has the date of 9/4/2014 (just before the version was released on 9/24/2014).
    After the 13.1 update is done (whenever date), that OldFilm.AEX file has the date of 1/31/2015. I first saw notification of the 13.1 Update
    release early in February 2015.
    2. Now in Premiere Elements 13.1, if I take my OldFilm.AEX (date 1/31/2015) and disable it by renaming it to OldFilm.AEXOLD, close out of there, and reopen
    the program, the OldFilm.AEX is not seen to regenerate. The OldFilm.AEXOLD remains there as its lone self.
    3. So, I am thinking that your OldFilm.AEXOLD in the screenshoot is "original equipment" that you disabled to get rid of No disc error.
    Why the OldFilm.AEX is there also is not clear, but the dating on it suggests that it came along with the 13.1 Update.
    Bottom line: let us try the deletion or disabling one more time and see what happens.
    Looking forward to further reports on your findings, as your time permits.
    Thanks.
    ATR

  • Wrongly payroll run for one employee, who left company several month ago

    Hi all,
    There is one case.
    One employee left company several months ago and his payroll data was also determined in the system. But the month payroll run included this guy not correctly. And also there are not any change found for his info type data with pc00_m16_uaud. But system shows the payroll administer, who run the payroll this month, changed his payroll master data in infotype 3.
    Any suggestion about this case will be appreciated.
    Julian

    Hi Jullian
    A Retro payroll runs if  "Earl.pers. RA date" is changed in Infotype 3. This also changes if there is any master data change in any payroll related Infotype like 8, 14, 15 etc. Please check if any data has changed for the employee to cause Retro payroll run.
    Thanks

  • Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal, How can i know whether my phone is in use??

    Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal bcz it seems to be wiped out all data including settings. it might be in use somewhere turning new fresh Gadget.  How can i know whether my phone is in use??

    You would know for a fact if the device is in use, but if you go back to the find my iPhone app in iCloud.com, you can either select to erase it, or place it in lost mode, in which case, once the device makes a connection to the internet, it will automatically go into that mode.

  • How can I sync my iPad to a computer after syncing it to the iCloud? I have the option of setting it up new, or restoring to a sync from many months ago. I dont want to lose any apps but I would like to back up on computer. No auto sync like other devices

    How can I sync my iPad to a computer after syncing it to the iCloud? I have the option of setting it up new, or restoring to a sync from many months ago. I dont want to lose any apps but I would like to back up on computer. No auto sync like other devices.

    Plug it into your computer. Tell it to sync with "this computer" instead of iCloud. You shouldn't have to remove any apps. Otherwise, you can save the app data by using i-FunBox ( http://www.i-funbox.com/ ) just go to the "devices" tab and select 'user applications' and select all of your apps and tell iFunBox to "copy to pc" you're done! You have them all backed up.

  • I just recently got back from iraq and bought a iphone 4 like 4 months ago. I finally got my computer back and I hooked up my phone to the computer to sync and register my phone. I clicked on restore previous settings and now my phone has all my old stuf.

    I just recently got back from Iraq like 4 months ago and I bought the new Iphone 4. I didnt have my computer with me because I was moving to a new duty station. I just got my computer yesterday and I hooked my iphone to the computer. Instead of hit set up as a new phone, I end up clicking on restore previous settings. Now all my new pictures, contact, videos, etc, are gone. I have my phone with old stuff from over a year ago. Is there a way for me to get my current stuff back. Did itunes save it somewhere and I dont know how to get it. Please help me out. Let me know if I can get it back or not.

    If you restored your iPhone rather than synching it, you've lost all that data.

  • MS office 2008 now crashing when we try to print. No changes to computer; same old software. New printer 9 months ago, no trouble printing until last month. Other programs (adobe, mac) print fine. What can I try?

    I have an iMac from 2009. It's running OSX 10.6.8 and we've used MS Office 2008 for Mac all along without any trouble.  We replaced our printer 8 or 9 months ago, and we've had no trouble printing from any program until the last several weeks. Now, when we try to print ONLY from word or excel, the print window appears, but then the spinning rainbow comes up, followed by a Microsoft crash message: "Microsoft Word has encountered a problem and needs to close. We are sorry for the inconvenience." I tried to trick it into making a PDF, but the crash comes too fast. The only change to our entire Mac ecosystem is the following: We also have a Macbook Pro that has the 2nd allowed installation of the same MS Office 2008 for Mac. Due to liquid damage 6 weeks ago, that computer was replaced and all of the data and applications were moved from the dead one to the new one. Could this possibly be because microsoft detects a "third" computer "using" its software? I'm guessing no because I've seen several threads about problems similar to mine, and none mention licensing issues. In terms of troubleshooting, I've shut down, unplugged, restarted and tried newly created docs as well as old ones. Same results, no matter what.

    http://answers.microsoft.com/en-us/mac/forum/macoffice2008?tab=Threads
    27" i7 iMac (Mid 2011) refurb, OS X Yo (10.10.2), Mavs, ML & SL, G4 450 MP w/10.5 & 9.2.2

  • Offered the Edge program months ago, as a solution to reduce current bill, and compete with other providers. Offer no longer available till next year, then November, then October 2nd, now given confirmation number that can be looked up but not completed?

    Final offer is to just continue to pay $260/mo, and call back on October 2nd, as that is the date I can change my four lines to EDGE and save per month. The initial offer did not include a $25/line discount and required me to Upgrade my phones. I have four Iphone 5S model devices, sharing 10GB of data.
    Months ago that offer would just cost more per month and lacked a device to offer me. Later I saw an add that mentioned a $25/line discount for Edge. That would drop my bill $100/month! I asked about the plan again at that time. I was told that I was still eligible,but there was no way to keep my current phones, and work them into the Edge plan. Once the Iphone 6 was announced, I now had a phone that was an upgrade, and I was ready to take the offer. I was told at a store that the offers have no specific terms, and they must be taken when offered. They said I would qualify for another chance in November! I called CS and was told that my next Offer to take the plan would be October 2nd. I went online and at 3:01am EST to pre-order. My phones ship date was October 7th, and I was told that, I then qualified for the Edge, due to the date, but only one line could be activated that way and the rest needed to be done at a store. I was given a confirmation number. Due to glitches that night, I placed this order on my own computer and the customer service agent at the same time, (he was on with me for 3 hours) till one of us was successful. My computer gave me the confirmation number, but the number is a customer service generated confirmation number. Internet services cannot help me confirm the order, because the number is CS. CS cannot help because I did it online. My plan has not changed and going to a verizon store, after staying up all night to preorder, I was told that they have no idea if it went through or not, and to wait and see if my order arrives at home on the 7th. During the store managers "search" he asked for my password,number/username, secret questions, secret site picture (confirmed) last four of my social, kept my family and I in the store 40 min past closing time, answering nothing and leaving me concerned in my sleep deprived state. Calling CS after that, only told me to change my password and again, wait till October 7th, as neither CS or internet dept. are sure of what happened. Neither would actually put a supervisor on the phone, it disconnects while waiting. Has anyone else ever had this happen to them? I don't feel like its safe to go to the local verizon store. CS did not feel as though the managers actions were disciplinary other than to change my password immediately, to prevent unauthorized access. Who are you supposed to trust with your private information? who can you trust to get the truth? The only thing the run around has done is prevent me from pre-ordering from another provider. I was even told that if I did, and Verizon preorders also came on the 7th, that I would have to pay for them too. $35 restocking fee at minimum. 

    Yes, I am aware of the new phone costs being added back to the plan. My issue is not with the current iteration of the EDGE plan, but with the inconsistent instructions to implement the plan. So far no one can tell me what changes have been made, if any to my current plan. The status of the pre-order? Plus my security concerns have not yet been addressed.
    What they will offer, is the EDGE plan, plus specific dates of delivery, for any additional lines that I would like to order above and beyond my current 4 lines. Yet the status of those lines are still in limbo. That was the term they used. Why would I want to purchase additional phones and lines of service when they cannot find my original order. If those phones do arrive in October, they would add 4 more lines of service totaling 8 lines of EDGE. I am not sure why this cannot be fixed beyond, wait and see. I am currently testing out an Iphone 5S with T-mobile. So far I am getting similar signal quality, and they offer Wifi calling that will be enabled with a new iPhone 6, that needs to be taken into account with the comparison. I've read that Verizon will enable the feature mid 2015. Four Iphone Plus models would run me about $225/mo as the most expensive option, still saving me monthly. I know verizon has good service where I live, tmobile is unknown, and after being treated so poorly, I am looking into with the test phone.

  • I bought my I pod touch 3-4 months ago and I got this message all of a sudden, it said something along the lines of provisonal complete_Distrib... will expire in 30 days. What is this it's under setting-general-Profile should I be worried?

    I bought my I pod touch 3-4 months ago and I got this message all of a sudden, it said something along the lines of provisonal complete_Distrib... will expire in 30 days. What is this it's under setting-general-Profile should I be worried? Should I just let it expire.

    Unless you have a company or school iPod, that profile was installed by an app you installed. It is likely that the app will no longer function when that date is reached. You can Google the name of the profile and that may provide some more information.

  • HT1766 I cannot backup my iphone, it keeps telling me the backup is corrupt and not compatible. All forums have suggested I delete the last backup but that was months ago and I'm afraid if I do that and it still doesn't work, I won't have anything saved

    I cannot backup my iphone, it keeps telling me the backup is corrupt and not compatible. All forums have suggested I delete the last backup but that was months ago and I'm afraid if I do that and it still doesn't work, I won't have anything saved. Can anyone help?

    Try to connect in recovery mode, explained in this article:
    iOS: Unable to update or restore
    Before that, back up your device, explained here:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    How to back up your data and set up as a new device
    You can check your warranty status here:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • HT1766 I recently replaced my iphone and took 6 weeks of new pictures, I plugged it to my computer and by accident I restored the back from 4 months ago and erased my new pictures. How can I recover the new pictures ?? Help!!

    I recently replaced my iphone and took 6 weeks of new pictures, I plugged it to my computer and by accident I restored the back from 4 months ago and erased my new pictures. How can I recover the new pictures ?? Help!!

    Sorry those pics might be gone, since you restored from your backup.
    Only way possible if by some possibility you were able to backup your current data to itunes, then you can restore from that backup.
    Open itunes - edit - preference - devices - backup - see if there is an up to date backup.
    If you don't have one then sorry those pics are gone.

Maybe you are looking for