Convert elapsed to HH:MM:SS

what needs to be done to convert elapsedtime to HH:MM:SS
thanks
Pappan

Hi,
With the help of TO_CHAR, string operations can be used on DATE values to extract the time:.
select to_char(sysdate, 'HH24:MI:SS') as "Current Time"
from dual;--
Paulo Vale
http://apex-notes.blogspot.com

Similar Messages

  • Mail crashes after a re-installation of 10.9.4

    I had some issues with my MacMini Server that I had taken into desktop use. I think it had originally 10.6 something + server. I had upgraded the os to 10.9.4 the normal route and decided to do a re-install 10.9.4 on a cleaned startup drive. I did a clean install and then used migration assistant to load apps and settings. Data is on an other drive & NAS.
    After reinstall and restore, I did have some hickups with my old data drive, where the user directories are located. I had to run sudo chown to reclaim ownership of the user directories and get access to them.
    All seems to pretty well except mail crashed initially every time I try to send a message. It just froze. Then I found a reference to deleting ~/library/containers/com.apple.mail, which I did. This resulted in Mail crashing at startup.
    In this discussion:
    https://discussions.apple.com/message/26279588
    I saw a link to EtreCheck and also a long command line diagnostic rest procedure by Linc Davies. I ran both:
    EtreCheck version: 1.9.12 (48)
    Report generated 4 August 2014 17:52:42 EEST
    Hardware Information:
        Mac mini Server (Mid 2010) (Verified)
        Mac mini - model: Macmini4,1
        1 2.66 GHz Intel Core 2 Duo CPU: 2 cores
        8 GB RAM
    Video Information:
        NVIDIA GeForce 320M - VRAM: 256 MB
            Acer P236H 1920 x 1080 @ 60 Hz
            Acer P236H 1920 x 1080 @ 60 Hz
    System Software:
        OS X 10.9.4 (13E28) - Uptime: 1 day 23:15:40
    Disk Information:
        OWC Mercury Electra 6G SSD disk0 : (120,03 GB)
            EFI (disk0s1) <not mounted>: 209,7 MB
            Boot HD (disk0s2) / [Startup]: 119,17 GB (75,4 GB free)
            Recovery HD (disk0s3) <not mounted>: 650 MB
        Hitachi HTS725050A9A362 disk1 : (500,11 GB)
            EFI (disk1s1) <not mounted>: 209,7 MB
            Data HD (disk1s2) /Volumes/Data HD: 499,25 GB (97,52 GB free)
    USB Information:
        Logitech USB Receiver
        JMicron Samsung S1 Mini 160,04 GB
            EFI (disk2s1) <not mounted>: 209,7 MB
            JS 160 GB (disk2s2) /Volumes/JS 160 GB: 159,7 GB (8,41 GB free)
        Apple Inc. MacBook Air SuperDrive
        Apple Inc. BRCM2070 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Computer, Inc. IR Receiver
    Gatekeeper:
        Mac App Store and identified developers
    Kernel Extensions:
        [not loaded]    com.Belcarra.iokit.USBLAN_netpart (3.1.1 - SDK 10.6) Support
        [not loaded]    com.Belcarra.iokit.USBLAN_usbpart (3.1.1 - SDK 10.6) Support
        [loaded]    com.Cycling74.driver.Soundflower (1.6.6 - SDK 10.6) Support
        [not loaded]    com.RemoteControl.USBLAN.usbpart (3.1.1 - SDK 10.7) Support
        [loaded]    com.bresink.driver.BRESINKx86Monitoring (9.0) Support
        [not loaded]    com.contourdesign.driver.shuttle (2.2) Support
        [not loaded]    com.elgato.driver.DontMatchAfaTech (1.1) Support
        [not loaded]    com.elgato.driver.DontMatchCinergy450 (1.1) Support
        [not loaded]    com.elgato.driver.DontMatchCinergyXS (1.1) Support
        [not loaded]    com.elgato.driver.DontMatchEmpia (1.1) Support
        [not loaded]    com.elgato.driver.DontMatchVoyager (1.1) Support
        [loaded]    com.manycamllc.driver.ManyCamDriver (0.0.9 - SDK 10.5) Support
        [loaded]    com.senstic.driver.PocketAudioDevice (1.2 - SDK 10.6) Support
        [loaded]    com.senstic.driver.PocketCamDevice (1.0.0 - SDK 10.7) Support
        [not loaded]    com.senstic.driver.PocketCamDevice.UserClient (1.0.0 - SDK 10.7) Support
        [loaded]    com.splashtop.driver.SRXDisplayCard (1.6 - SDK 10.7) Support
        [loaded]    com.splashtop.driver.SRXFrameBufferConnector (1.6 - SDK 10.7) Support
    Startup Items:
        ChmodBPF: Path: /Library/StartupItems/ChmodBPF
    Problem System Launch Daemons:
        [failed]    com.apple.wdhelper.plist
    Launch Daemons:
        [loaded]    com.adobe.fpsaud.plist Support
        [loaded]    com.microsoft.office.licensing.helper.plist Support
        [loaded]    com.oracle.java.JavaUpdateHelper.plist Support
        [loaded]    com.senstic.DPA.PocketCamAssistant.plist Support
        [failed]    com.senstic.PocketCam.DriverReloader.plist Support
        [running]    com.splashtop.streamer-daemon.plist Support
        [loaded]    com.splashtop.streamer-srioframebuffer.plist Support
        [running]    com.voddler.vnetd.plist Support
        [running]    com.wyse.PocketCloud.plist Support
        [loaded]    org.macosforge.xquartz.privileged_startx.plist Support
    Launch Agents:
        [not loaded]    com.splashtop.streamer-for-root.plist Support
        [loaded]    com.splashtop.streamer-for-user.plist Support
        [running]    com.synology.SynoSIMBL.plist Support
        [loaded]    com.synology.SynoSIMBL_RefreshFinder.plist Support
        [not loaded]    com.wyse.MacCompanion.plist Support
        [loaded]    org.macosforge.xquartz.startx.plist Support
    User Launch Agents:
        [not loaded]    com.erikhinterbichler.HeraldLaunchAgent.plist Support
        [running]    com.google.Chrome.framework.plist Support
        [not loaded]    com.google.GoogleContactSyncAgent.plist Support
        [not loaded]    com.google.keystone.agent.plist Support
        [not loaded]    com.macpaw.CleanMyMac2Helper.diskSpaceWatcher.plist Support
        [not loaded]    com.macpaw.CleanMyMac2Helper.scheduledScan.plist Support
        [not loaded]    com.macpaw.CleanMyMac2Helper.trashWatcher.plist Support
        [not loaded]    com.synology.CloudStation.plist Support
        [invalid]    de.gira.os.connect.plist
    User Login Items:
        BoxSyncHelper
        iTunesHelper
        ede
        hallinto
        home
        music
        photo
        video
        yhteinen
        Dropbox
        OpenDNS Updater
    Internet Plug-ins:
        Flip4Mac WMV Plugin: Version: 3.2.0.16   - SDK 10.8 Support
        FlashPlayer-10.6: Version: 14.0.0.145 - SDK 10.6 Support
        iPhotoPhotocast: Version: 7.0 - SDK 10.8
        Flash Player: Version: 14.0.0.145 - SDK 10.6 Support
        Default Browser: Version: 537 - SDK 10.9
        QuickTime Plugin: Version: 7.7.3
        SharePointBrowserPlugin: Version: 14.4.1 - SDK 10.6 Support
        Unity Web Player: Version: UnityPlayer version 4.3.7f1 - SDK 10.6 Support
        Silverlight: Version: 5.1.30214.0 - SDK 10.6 Support
        DirectorShockwave: Version: 11.6.8r638 Support
        JavaAppletPlugin: Version: Java 7 Update 65 Check version
    Safari Extensions:
        Evernote Web Clipper: Version: 6.1.3
    Audio Plug-ins:
        BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
        AirPlay: Version: 2.0 - SDK 10.9
        AppleAVBAudio: Version: 203.2 - SDK 10.9
        iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
        Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    User Internet Plug-ins:
        Picasa: Version: 1.0 - SDK 10.4 Support
        Google Earth Web Plug-in: Version: 7.1 Support
    3rd Party Preference Panes:
        Box Sync  Support
        Flash Player  Support
        Flip4Mac WMV  Support
        Gira OS Connect  Support
        VoddlerNet  Support
    Time Machine:
        Mobile backups: OFF
        Auto backup: NO - Auto backup turned off
        Time Machine not configured!
    Top Processes by CPU:
            39%    firefox
            24%    plugin-container
             4%    WindowServer
             1%    vnetd
             0%    fontd
    Top Processes by Memory:
        1.46 GB    firefox
        328 MB    plugin-container
        147 MB    App Store
        139 MB    WindowServer
        123 MB    Finder
    Virtual Memory Information:
        1.24 GB    Free RAM
        2.92 GB    Active RAM
        1.48 GB    Inactive RAM
        1.26 GB    Wired RAM
        4.30 GB    Page-ins
        685 MB    Page-outs
    Here are the results for Linc's script:
    Start time: 17:39:53 08/04/14
    Model Identifier: Macmini4,1
    System Version: OS X 10.9.4 (13E28)
    Kernel Version: Darwin 13.3.0
    Boot Mode: Normal
    Time since boot: 1 day23:02
    Memory
        BANK 0/DIMM0:
          Size: 4 GB
          Speed: 1067 MHz
          Status: OK
          Manufacturer: 0x857F
        BANK 1/DIMM0:
          Size: 4 GB
          Speed: 1067 MHz
          Status: OK
          Manufacturer: 0x857F
    SATA
       OWC Mercury Electra 6G SSD             
       Hitachi HTS725050A9A362                
    USB
       USB2.0 Hub (Genesys Logic, Inc.)
       USB Receiver (Logitech Inc.)
       Samsung S1 Mini (Samsung Electronics Co., Ltd.)
    Diagnostic reports
       2014-08-02 CalendarAgent crash
       2014-08-02 Finder crash *
       2014-08-02 Finder crash *
       2014-08-02 Finder crash *
       2014-08-02 Finder crash *
       2014-08-02 Finder hang
       2014-08-02 Finder hang
       2014-08-02 Finder crash
       2014-08-02 plugin-container crash
       2014-08-02 plugin-container crash
       2014-08-03 Mail hang
       2014-08-04 Mail hang
       2014-08-04 Mail hang
       2014-08-04 Mail hang
       2014-08-04 Mail hang
       2014-08-04 Maps hang
           * Code injection
    Log
       Aug  2 18:39:02 process SecurityAgent[174] caught causing excessive wakeups. Observed wakeups rate (per sec): 989; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45272
       Aug  2 18:41:53 process WindowServer[126] caught causing excessive wakeups. Observed wakeups rate (per sec): 182; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45156
       Aug  2 18:49:44 PM notification timeout (pid 118, SRStreamerDaemon)
       Aug  2 18:56:32 AppleKeyStore: operation failed (pid: 373 sel: 7 ret: e00002bc)
       Aug  2 18:56:43 AppleKeyStore: operation failed (pid: 385 sel: 7 ret: e00002bc)
       Aug  2 19:21:48 PM notification timeout (pid 118, SRStreamerDaemon)
       Aug  2 19:21:48 PM notification timeout (pid 289, soagent)
       Aug  2 19:35:22 PM notification timeout (pid 118, SRStreamerDaemon)
       Aug  2 19:35:22 PM notification timeout (pid 289, soagent)
       Aug  2 19:35:52 PM notification timeout (pid 289, soagent)
       Aug  2 20:28:44 PM notification timeout (pid 118, SRStreamerDaemon)
       Aug  2 20:28:44 PM notification timeout (pid 289, soagent)
       Aug  2 20:28:44 PM notification timeout (pid 583, Finder)
       Aug  3 00:04:51 jnl: disk2s2: do_jnl_io: strategy err 0x6
       Aug  3 00:04:51 jnl: disk2s2: write_journal_header: error writing the journal header!
       Aug  3 00:04:51 jnl: disk2s2: close: journal 0xffffff802df49a80, is invalid.  aborting outstanding transactions
       Aug  3 00:05:02 jnl: disk2s2: replay_journal: from: 7565312 to: 589312 (joffset 0x77000)
       Aug  3 00:05:03 jnl: disk2s2: journal replay done.
       Aug  3 00:39:17 process plugin-container[2666] caught causing excessive wakeups. Observed wakeups rate (per sec): 162; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 3010684
       Aug  3 03:50:40 process iPhoto[2969] caught causing excessive wakeups. Observed wakeups rate (per sec): 349; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45002
       Aug  3 04:14:12 process plugin-container[2666] caught causing excessive wakeups. Observed wakeups rate (per sec): 437; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 5693175
       Aug  3 11:15:37 process Microsoft Excel[3310] caught causing excessive wakeups. Observed wakeups rate (per sec): 659; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 45095
       Aug  4 13:53:14 process firefox[2657] thread 111463 caught burning CPU! It used more than 50% CPU (Actual recent usage: 60%) over 180 seconds. thread lifetime cpu usage 11438.343277 seconds, (11006.021888 user, 432.321389 system) ledger info: balance: 90009054761 credit: 11326939195773 debit: 11236930141012 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 148957019472
       Aug  4 13:59:30 process plugin-container[2666] caught causing excessive wakeups. Observed wakeups rate (per sec): 310; Maximum permitted wakeups rate (per sec): 150; Observation period: 300 seconds; Task lifetime number of wakeups: 28235109
       Aug  4 17:36:22 process JavaAppLauncher[9520] thread 718667 caught burning CPU! It used more than 50% CPU (Actual recent usage: 54%) over 180 seconds. thread lifetime cpu usage 164.849341 seconds, (153.860927 user, 10.988414 system) ledger info: balance: 90002698760 credit: 164703528455 debit: 74700829695 limit: 90000000000 (50%) period: 180000000000 time since last refill (ns): 164376764630
    Activity
       CPU: user 35%, system 9%
    CPU per process: firefox (UID 501) is using 48.9  %
    Memory: firefox (UID 501) is using 1418 MB
    kexts
       com.senstic.driver.PocketCamDevice (1.0.0)
       com.manycamllc.driver.ManyCamDriver (0.0.9)
       com.senstic.driver.PocketAudioDevice (1.2)
       com.Cycling74.driver.Soundflower (1.6.6)
       com.splashtop.driver.SRXDisplayCard (1.6)
       com.splashtop.driver.SRXFrameBufferConnector (1.6)
       com.bresink.driver.BRESINKx86Monitoring (9.0)
    Daemons
       com.wyse.PocketCloud
       org.macosforge.xquartz.privileged_startx
       com.voddler.vnetd
       com.splashtop.streamer-srioframebuffer
       com.splashtop.streamer-daemon
       com.senstic.PocketCam.DriverReloader
       com.senstic.DPA.PocketCamAssistant
       com.oracle.java.JavaUpdateHelper
       com.microsoft.office.licensing.helper
       com.adobe.fpsaud
    Agents
       com.jamesfator.OCR-Wand-Helper
       com.google.Chrome.framework.service_process/Volumes/Data_HD/JUSSI/Library/Appli cation_Support/Google/Chrome
       org.macosforge.xquartz.startx
       com.synology.SynoSIMBL_RefreshFinder
       com.synology.SynoSIMBL
       com.splashtop.streamer-for-user
    launchd
       /System/Library/LaunchAgents/com.apple.servernotifyd.plist
       -    com.apple.servernotifyd
       /Library/LaunchAgents/com.splashtop.streamer-for-root.plist
       -    com.splashtop.streamer-for-root
       /Library/LaunchAgents/com.splashtop.streamer-for-user.plist
       -    com.splashtop.streamer-for-user
       /Library/LaunchAgents/com.synology.SynoSIMBL.plist
       -    com.synology.SynoSIMBL
       /Library/LaunchAgents/com.synology.SynoSIMBL_RefreshFinder.plist
       -    com.synology.SynoSIMBL_RefreshFinder
       /Library/LaunchAgents/com.wyse.MacCompanion.plist
       -    com.wyse.MacCompanion
       /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
       -    org.macosforge.xquartz.startx
       /Library/LaunchDaemons/com.adobe.fpsaud.plist
       -    com.adobe.fpsaud
       /Library/LaunchDaemons/com.apple.serverd.plist
       -    com.apple.serverd
       /Library/LaunchDaemons/com.microsoft.office.licensing.helper.plist
       -    com.microsoft.office.licensing.helper
       /Library/LaunchDaemons/com.oracle.java.JavaUpdateHelper.plist
       -    com.oracle.java.JavaUpdateHelper
       /Library/LaunchDaemons/com.senstic.DPA.PocketCamAssistant.plist
       -    com.senstic.DPA.PocketCamAssistant
       /Library/LaunchDaemons/com.senstic.PocketCam.DriverReloader.plist
       -    com.senstic.PocketCam.DriverReloader
       /Library/LaunchDaemons/com.splashtop.streamer-daemon.plist
       -    com.splashtop.streamer-daemon
       /Library/LaunchDaemons/com.splashtop.streamer-srioframebuffer.plist
       -    com.splashtop.streamer-srioframebuffer
       /Library/LaunchDaemons/com.voddler.vnetd.plist
       -    com.voddler.vnetd
       /Library/LaunchDaemons/com.wyse.PocketCloud.plist
       -    com.wyse.PocketCloud
       /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
       -    org.macosforge.xquartz.privileged_startx
       Library/LaunchAgents/com.apple.serveralertproxy.plist
       -    com.apple.serveralertproxy
       Library/LaunchAgents/com.erikhinterbichler.HeraldLaunchAgent.plist
       -    com.erikhinterbichler.HeraldLaunchAgent
       Library/LaunchAgents/com.google.Chrome.framework.plist
       -    com.google.Chrome.framework.service_process/Volumes/Data_HD/JUSSI/Library/Appli cation_Support/Google/Chrome
       Library/LaunchAgents/com.google.GoogleContactSyncAgent.plist
       -    com.google.GoogleContactSyncAgent
       Library/LaunchAgents/com.google.keystone.agent.plist
       -    com.google.keystone.user.agent
       Library/LaunchAgents/com.macpaw.CleanMyMac2Helper.diskSpaceWatcher.plist
       -    com.macpaw.CleanMyMac2Helper.diskSpaceWatcher
       Library/LaunchAgents/com.macpaw.CleanMyMac2Helper.scheduledScan.plist
       -    com.macpaw.CleanMyMac2Helper.scheduledScan
       Library/LaunchAgents/com.macpaw.CleanMyMac2Helper.trashWatcher.plist
       -    com.macpaw.CleanMyMac2Helper.trashWatcher
       Library/LaunchAgents/com.synology.CloudStation.plist
       -    N/A
       Library/LaunchAgents/de.gira.os.connect.plist
       -    N/A
    Startup items
       /Library/StartupItems/BRESINKx86Monitoring/BRESINKx86Monitoring
       /Library/StartupItems/BRESINKx86Monitoring/BRESINKx86Monitoring.kext/Contents/I nfo.plist
       /Library/StartupItems/BRESINKx86Monitoring/BRESINKx86Monitoring.kext/Contents/M acOS/BRESINKx86Monitoring
       /Library/StartupItems/BRESINKx86Monitoring/StartupParameters.plist: Permission denied
       /Library/StartupItems/ChmodBPF/ChmodBPF
       /Library/StartupItems/ChmodBPF/StartupParameters.plist
    Bundles
       /Library/Audio/Plug-Ins/Components/Flip4Mac WMA Import.component
       -    net.telestream.wmv.import
       /Library/Internet Plug-Ins/DirectorShockwave.plugin
       -    com.adobe.shockwave.pluginshim
       /Library/Internet Plug-Ins/Flash Player.plugin
       -    N/A
       /Library/Internet Plug-Ins/Flip4Mac WMV Plugin.plugin
       -    net.telestream.wmv.plugin
       /Library/Internet Plug-Ins/iPhotoPhotocast.plugin
       -    com.apple.plugin.iPhotoPhotocast
       /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
       -    com.oracle.java.JavaAppletPlugin
       /Library/Internet Plug-Ins/SharePointBrowserPlugin.plugin
       -    com.microsoft.sharepoint.browserplugin
       /Library/Internet Plug-Ins/SharePointWebKitPlugin.webplugin
       -    com.microsoft.sharepoint.webkitplugin
       /Library/Internet Plug-Ins/Silverlight.plugin
       -    com.microsoft.SilverlightPlugin
       /Library/Internet Plug-Ins/Unity Web Player.plugin
       -    com.unity.UnityWebPlayer
       /Library/PreferencePanes/Box Sync.prefPane
       -    net.box.sync.preferences
       /Library/PreferencePanes/Flash Player.prefPane
       -    com.adobe.flashplayerpreferences
       /Library/PreferencePanes/Flip4Mac WMV.prefPane
       -    net.telestream.wmv.prefpane
       /Library/PreferencePanes/VoddlerNet.prefPane
       -    com.voddler.VoddlerNet
       /Library/QuickTime/Flip4Mac WMV Advanced.component
       -    net.telestream.wmv.advanced
       /Library/QuickTime/Flip4Mac WMV Export.component
       -    net.telestream.wmv.export
       /Library/QuickTime/Flip4Mac WMV Import.component
       -    net.telestream.wmv.import
       /Library/QuickTime/macam.component
       -    net.sourceforge.webcam-osx.common
       /Library/QuickTime/ManyCamVDig_RGB.component
       -    com.manycamllc.ManyCamVideoDigitizer_RGB
       /Library/QuickTime/ManyCamVDig_YCbCr.component
       -    com.manycamllc.ManyCamVideoDigitizer_YCbCr
       /Library/QuickTime/PocketCam.component
       -    com.senstic.pocketcam
       /Library/ScriptingAdditions/SynoCxtMenuSIMBL.osax
       -    net.culater.SynoCxtMenuSIMBL.osax
       /Library/ScriptingAdditions/SynoSIMBL.osax
       -    net.culater.SynoSIMBL.osax
       Library/Address Book Plug-Ins/SkypeABDialer.bundle
       -    com.skype.skypeabdialer
       Library/Address Book Plug-Ins/SkypeABSMS.bundle
       -    com.skype.skypeabsms
       Library/Caches/com.apple.Safari/Extensions/Evernote Web Clipper.safariextension
       -    com.evernote.safari.clipper
       Library/Internet Plug-Ins/Google Earth Web Plug-in.plugin
       -    com.Google.GoogleEarthPlugin.plugin
       Library/Internet Plug-Ins/Picasa.plugin
       -    com.google.PicasaPlugin
       Library/Mail/Bundles (Disabled)/Herald.mailbundle
       -    com.erikhinterbichler.Herald
       Library/PreferencePanes/Gira OS Connect.prefPane
       -    de.gira.os.connect.prefpane
       Library/Widgets/Currency Converter.wdgt
       -    net.palple.widget.currencyconverter
    Apps
       /Applications/Dropbox.app
    Contents of /System/Library/LaunchAgents/com.apple.servernotifyd.plist (XML  document text)
       <?xml version="1.0" encoding="UTF-8"?>
       <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
       <plist version="1.0">
       <dict>
           <key>ProgramArguments</key>
           <array>
               <string>/System/Library/Frameworks/ServerNotification.framework/Resources/serve rnotifyd</string>
           </array>
           <key>Label</key>
           <string>com.apple.servernotifyd</string>
           <key>MachServices</key>
           <dict>
               <key>com.apple.servernotifyd</key>
               <string>YES</string>
           </dict>
       </dict>
       </plist>
    Font issues: 37
    Bad plists
       /Library/Preferences/com.apple.serverd.plist
    Firewall: On
    DNS: 208.67.222.222
    Listeners
       launchd: afpovertcp
       launchd: microsoft-ds
       kdc: kerberos
    Wi-Fi
       link auth: none
    Restricted files: 10
    Safari extensions
       Evernote Web Clipper
    Widgets
       Currency Converter
    Elapsed time (s): 246
    I do not know if these are of any use, but I would appreciate educated guesses on where to start for a solution.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Step 1
    For this step, the title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    In the top right corner of the Console window, there's a search box labeled Filter. Initially the words "String Matching" are shown in that box. Enter the name of the crashed application or process. For example, if iTunes crashed, you would enter "iTunes" (without the quotes.)
    Each message in the log begins with the date and time when it was entered. Select the messages from the time of the last crash, if any. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    ☞ The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    ☞ Some private information, such as your name, may appear in the log. Anonymize before posting.
    Step 2
    In the Console window, select
              DIAGNOSTIC AND USAGE INFORMATION ▹ User Diagnostic Reports
    (not Diagnostic and Usage Messages) from the log list on the left. There is a disclosure triangle to the left of the list item. If the triangle is pointing to the right, click it so that it points down. You'll see a list of crash reports. The name of each report starts with the name of the process, and ends with ".crash". Select the most recent report related to the process in question. The contents of the report will appear on the right. Use copy and paste to post the entire contents—the text, not a screenshot.
    I know the report is long, maybe several hundred lines. Please post all of it anyway.
    If you don't see any reports listed, but you know there was a crash, you may have chosen Diagnostic and Usage Messages from the log list. Choose DIAGNOSTIC AND USAGE INFORMATION instead.
    In the interest of privacy, I suggest that, before posting, you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header of the report, if it’s present (it may not be.)
    Please don’t post other kinds of diagnostic report—they're very long and rarely helpful.

  • Converting seconds to elapsed time format

    Hi:
    I'm trying to do something like...
    select to_char(3661,'hh24:mm:ss') from dual;
    ...to get...
    01:01:01
    3661 being the number of seconds in 1hour + 1 minute + 1 second. to_char(62,'hh24:mm:ss') would be 00:01:02, etc... .
    Any ideas?
    Thanks in Advance

    Hi,
    The previous answer will work how long the number of seconds will be less than 86400(the number of seconds of a day).
    So, for a greater number of seconds you have to use an arithmetical transformation:
    For example:
    Let's say that we have to transform 190 000 into days, hours, minutes and seconds.
    select trunc(190000/86400) days,
    trunc((mod (190000,86400)/86400)*24) hours,
    trunc( ( (mod(190000,86400)/86400)*24 -
    trunc((mod(190000,86400)/86400)*24) ) * 60 )
    minutes
    -- so on ...
    from dual;
    DAYS HOURS MINUTES
    ___2 _______4 ______46
    So, if you want that format 'dd hh24:mi:ss', you have to use concat operator and, eventually, lpad function
    (i.e. lpad(expresion,2,'0') ).
    Eugen

  • Can Oracle convert literals to bind variables?

    Good morning everyone.
    I have a procedure similar to this in our database:
        FUNCTION Get_Tag_Element_Id_For_Set(Element_Attr_Id_Table_In   in    ATTRIBUTE_TABLE_ID_TAB) RETURN NUMBER IS
          v_Select_Statement                    VARCHAR2(32767);
          v_Element_Id                             ELEMENT.Element_Id%TYPE;
        BEGIN
          FOR I IN 1..Element_Attr_Id_Table_In.COUNT LOOP
            IF v_Select_Statement IS NULL THEN
              v_Select_Statement := 'SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Element_Attribute_Id = ' || Element_Attr_Id_Tab_In(i);
            ELSE
              v_Select_Statement := v_Select_Statement || ' intersect ' ||
                                    'SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Element_Attribute_Id = ' || Element_Attr_Id_Table_In(i);
            END IF;
          END LOOP;
          EXECUTE IMMEDIATE v_Select_Statement INTO v_Element_id;
          RETURN v_Element_Id;
        END;What this does is to create a query similar to this:
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 1 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 2 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 3 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 4 intersect
    SELECT distinct Element_Id FROM ELEMENT_ATTRIBUTE_MANY_2_MANY WHERE Tag_Element_Attribute_Id = 5;
    I am using Dynamic SQL because the number of intersect pieces can vary from 1 to 15 and in the future it can grow.
    The problem that I have is that because the literals are part of the string, the query is being hard parsed every single time. In our production environment this means 100s of thousands of times per day which according to our DBA has added 15% plus to our average load. I know that I can come up with a rewrite to avoid this, but I was wondering if there is a parameter I can set at the session or at the database level where the database itself can convert this kind of query into one with bind variables.
    Thanks,
    Tom
    Edited by: Thomas Morgan on May 3, 2013 8:21 PM

    Thomas Morgan wrote:
    Basically I have an XML document.
    The document has ELEMENTS.
    ELEMENTS can have attributes.
    There is a many to many relationship between ELEMENT and ATTRIBUTES so I have a XREF table to represent this relationship.
    When I receive a new document, I need to determine if a group of ATTRIBUTES already exist together in the XREF table so I have to find their common ELEMENT_ID or NULL in which case I would create a new ELEMENT and associate the new set of attributes to the new ELEMENT.
    Since the number of attributes can vary from 1 to around 15 for now, I had to dynamically build the query that find the common ID(intersect) if it exists.
    Here is some DDL and inserts:
    CREATE TABLE ELEMENT(ELEMENT_ID NUMBER NOT NULL);
    CREATE TABLE ELEMENT_ELEMENT_ATTRIBUTE_XREF(Element_Id NUMBER NOT NULL, Element_Attribute_Id NUMBER NOT NULL);
    ALTER TABLE ELEMENT_ELEMENT_ATTRIBUTE_XREF ADD CONSTRAINT ELEMENT_ATTR_MANY_2_MANY_PK PRIMARY KEY(Element_Id, Element_Attribute_Id);
    ALTER TABLE ELEMENT ADD CONSTRAINT ELEMENT_PK PRIMARY KEY(Element_Id);
    INSERT INTO ELEMENT VALUES(1);
    INSERT INTO ELEMENT VALUES(2);
    INSERT INTO ELEMENT VALUES(3);
    INSERT INTO ELEMENT VALUES(4);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(1, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(1, 2);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(2, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 1);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 3);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 4);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(3, 5);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(4, 6);
    INSERT INTO ELEMENT_ELEMENT_ATTRIBUTE_XREF VALUES(4, 7);
    So for instance if I passed an array (Attribute ID Tab) containing ELEMENT_ATTRIBUTE_ID list 6 and 7 I would get 4 as the answer.
    Hope this helps,
    Thanks,
    TomAwesome, thanks!
    I'm not sure this works 100% for what you need, but I thought I'd give it a shot. I've used a built in array (sys.odcinumberlist) that you should have access to on your installation (assuming you have a relatively recent version of Oracle).
    I left out the part where you would loop through the array you are currently passing in to your procedure to build up this new array that you can use in a SQL statement.
    Cheers,
    create or replace procedure maybe_this
       in_list           sys.odcinumberlist
    is
       l_commonality     number;
    begin
       begin
          select
             distinct
                xref.element_id
          into
             l_commonality
          from
                table(cast(in_list as sys.odcinumberlist))  list
            ,  element_element_attribute_xref   xref
          where
             xref.element_attribute_id = list.column_value;
          dbms_output.put_line('match on element_id = ' || l_commonality);
       exception
          when too_many_rows or no_data_found
          then
             dbms_output.put_line('no match');
       end;
    end;
    ME_TUBBZ?exec maybe_this(sys.odcinumberlist(1,2));
    no match
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    ME_TUBBZ?exec maybe_this(sys.odcinumberlist(6,7));
    match on element_id = 4
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01

  • I have subscribed to convert PDF to Excel and Word, I have followed your instructions and I get an error message all the time.

    I have subscribed to convert PDF file to an Excel or Word . I have followed your instructions to do so but I always get an error message. I have chated with one representative who suggested that I wait 24h before I try it again implying that my subscription is in process. the time span has elapsed and when i try it, I still get the error message. HELP ME or REFUND me the money

    "an error message" really doesn't tell us much.
    [topic moved to ExportPDF forum]

  • How can I move back the rman convert file from file system to ASM?

    I have no idea on pluging-in the data files which were unloaded as follows:
    SQL> alter tablespace P_CDDH_DSPGD_V1_2011 read only;
    SQL> alter tablespace P_IDX_CDDH_DSPGD_V1_2011 read only;
    SQL> exec dbms_tts.transport_set_check('P_CDDH_DSPGD_V1_2011,P_IDX_CDDH_DSPGD_V1_2011',true);
    SQL> select * from transport_set_violations;
    UNIX> expdp tossadm@pmscdhf1 dumpfile=ttsfy1.dmp directory=trans_dir transport_tablespaces = P_CDDH_DSPGD_V1_2011,P_IDX_CDDH_DSPGD_V1_2011
    RMAN> convert tablespace P_CDDH_DSPGD_V1_2011, P_IDX_CDDH_DSPGD_V1_2011 format = '/appl/oem/backup/temp/%I_%s_%t_extbspace.dbf';
    Starting conversion at source at 03-OCT-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=116 instance=pmscdhf11 device type=DISK
    channel ORA_DISK_1: starting datafile conversion
    input datafile file number=00079 name=+PMSCDHF1/p_cddh_dspgd_v1_2011_01.dbf
    converted datafile=/appl/oem/backup/temp/3536350174_2820_827849001_extbspace.dbf
    channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:02:15
    channel ORA_DISK_1: starting datafile conversion
    input datafile file number=00080 name=+PMSCDHF1/p_idx_cddh_dspgd_v1_2011_02.dbf
    converted datafile=/appl/oem/backup/temp/3536350174_2821_827849136_extbspace.dbf
    channel ORA_DISK_1: datafile conversion complete, elapsed time: 00:01:45
    Finished conversion at source at 03-OCT-13
    Starting Control File Autobackup at 03-OCT-13
    piece handle=/dbms/oracle/r1110/db_01/dbs/c-3536350174-20131003-02 comment=NONE
    Finished Control File Autobackup at 03-OCT-13
    SQL> drop tablespace P_CDDH_DSPGD_V1_2011 including contents;
    SQL> drop tablespace P_IDX_CDDH_DSPGD_V1_2011 including contents;
    Afterward, how can I relocate the backup files "/appl/oem/backup/temp/3536350174_2820_827849001_extbspace.dbf", "/appl/oem/backup/temp/3536350174_2821_827849136_extbspace.dbf" back to the ASM group +PMSCDHF1 ???

    The 11.1 documentation only says  "Enables you to copy files between ASM disk groups on local instances to and from remote instances" and "You can also use this command to copy files from ASM disk groups to the operating system."
    http://docs.oracle.com/cd/B28359_01/server.111/b31107/asm_util.htm#CHDJEIEA
    The 11.2 documentation says "Copy files from a disk group to the operating system  Copy files from a disk group to a disk group Copy files from the operating system to a disk group"
    http://docs.oracle.com/cd/E11882_01/server.112/e18951/asm_util003.htm#CHDJEIEA
    I've never tried 11.1
    Hemant K Chitale

  • How to convert a numeric field representing UNIX time to a standard report

    Looking for some help on the creation of a formula that will allow me to convert a numeric string which represent Unix time to a standard date format.
    Sample string value "1199149200", Jan 1 2008, 1 AM

    Hi,
    Use the DateAdd formula convert Unix epoch to normal datetime (Unix epoch = number of seconds that have elapsed since January 1, 1970).
    DateAdd("s", 1199149200, datetime("01/01/1970 00:00:00"))
    Cheers,
    Fritz

  • Elapse days - calculation from month and year

    Duplicate thread ...
    coding  required for converting month into days
    I have Month and year field in my DSO --Year( 2009), Month(4)
    I want below logic to calculate -
    MTD qty % = (qty * elapse days) / no of days in month
    so from the above, I want to know,
    1. How can we get the no of days from the above 2 objects (year and month).
    2. Elapse days are the days that are over from current date to Ist day of that month.
    eg: current date - 04.03.2009 , 1st day of the month - 04.01.2009,
    elapse days = 2. (you need to consider all days in the month, not only working days)
    so my questions is how can we get, # of days n a month from above 2 fields and elapse days based on the above condition.
    also want to know, where can I have the logic in transformations or query level.
    please provide your suggestions.
    Thanks,
    Pra
    Edited by: Arun Varadarajan on Apr 5, 2009 10:44 PM
    Edited by: Arun Varadarajan on Apr 5, 2009 10:45 PM

    Hello,
    I think the sample program below does what you ask: it finds the days in the month (bit of an overkill to use function modules for that) and then computes the QTD.
    Note that the internal string representation of a data variable is always YYYYMMDD, regardless of the "externalized" form (e.g. yyyy/mm/dd or dd.mm.yyyy), so this code will work regardless of your custom date format.
    Regards,
    Mark
    REPORT  zqty_to_date.
    PARAMETERS:
      p_date     TYPE dats,
      p_qty      TYPE i.
    DATA:
      days      TYPE i,
      n_year    TYPE numc4,
      n_month   TYPE numc2,
      n_day     TYPE numc2,
      qtd(6)    TYPE p DECIMALS 1.
    START-OF-SELECTION.
      n_year = p_date+0(4).
      n_month = p_date+4(2).
      n_day = p_date+6(2).
      PERFORM days_in_month USING n_year n_month CHANGING days.
      qtd = ( p_qty * ( n_day - 1 ) ) / days.
      WRITE: / 'Days in month:', days,
             / 'Qty  to date :', qtd.
    *&      Form  days_in_month
    *       text
    FORM days_in_month USING year month CHANGING days.
      DATA: ymod4   TYPE i,
            ymod100 TYPE i,
            ymod400 TYPE i.
      CASE month.
        WHEN 4 OR 6 OR 9 OR 11.
          days = 30.
        WHEN 2.
          ymod4 = year MOD 4.
          ymod100 = year MOD 100.
          ymod400 = year MOD 400.
          IF ( ymod4 = 0 AND ymod100 > 0 ) OR ( ymod100 = 0 AND ymod400 = 0 ).
            days = 29.
          ELSE.
            days = 28.
          ENDIF.
        WHEN OTHERS.
          days = 31.
      ENDCASE.
    ENDFORM.                    "days_in_month

  • Write elapsed time to a spreadsheet in hours:minutes:seconds format

    Hi everyone,
    I've been trying to write an elapsed time to a spreadsheet file in an hours:minutes:seconds format, but the time is displayed in a floating point value of seconds..
    how can I write to a spreadsheet in an hours:minutes:seconds format.
    Thank you,
    James-

    I often use a subVI that converts Seconds to Hours, Minutes and Seconds. Use the Quotient and Remainder function to divide your elapsed time by 3600, 60 and 1. You can then convert those values to a modified string and use the Write to Spreadsheet File.
    As Dennis said, newer versions of LabVIEW's Write to Spreadsheet File.VI can handle arrays of Double, Integer or String automatically, and in older versions, the Write to Spreadsheet File.VI can be modified and copied to handle strings.
    Hope this helps.
    (Written in 8.5)
    Message Edited by LabViewGuruWannabe on 01-18-2008 09:28 PM
    Attachments:
    TimeToSpreadsheet.vi ‏26 KB
    SecondstoHMS.png ‏32 KB

  • When using historical datalogging, is it possible to hide the elapsed time between tag updates when viewing on a graph?

    When my process stops, I am reading an array of tags(datapoints) and writing the max and average to memory tags for data logging. However, when viewing the data, the elapsed time between cycles spreads the data out unevenly. It could be 90 seconds between cycles or maybe two hours or longer. Is there a way to convert the time axis data to be just consecutive datapoints?? It would be like logging data based on a particular condition happening rather than time-based trending. Should I try to use the data set logger examples instead?? I would prefer to use the built-in datalogging features rather than writing to databases.

    You could export your data to a spreadsheet file and then actually write then again in a second database using this example program in the devzone
    http://zone.ni.com/devzone/conceptd.nsf/webmain/5A921A403438390F86256B9700809A53?opendocument
    Using this program (if you don't want to modify it, which would take a reasonable amount of time specially if you are not familiar with VI-Based Server) You would have to generate a collum in your spreadsheet file to be the timestamp, it would be a artificial timestamp.
    What you could do in your application is to first save the data to file and then read from file, substitute the collum timestamp for the "artificial one" and then write it to the database, again, with that you would not need to modify this program.
    However if you have the time and is willing to work with VI-based server you could try to modify the example program to be adapted for your purposes.
    I hope it helps
    Good Luck
    Andre Oliveira
    Applications Engineer
    National Instruments

  • Convert Data time stamp to Local Time

    Hello,
    I want to convert this input to local time EST.
    Input:12/8/2006 10:23:00.000000000 PM -06:00
    o/p: EST.Local Time

    Is the input a string? A timestamp? If so, which flavor of timestamp? Something else?
    Normally, you'd want to use a TIMESTAMP WITH LOCAL TIME ZONE data type for this sort of requirement, since it automatically converts data to the client's time zone. Assuming the input is a string and that the client's time zone is set to EST
      1  select cast(to_timestamp_tz( '12/8/2006 10:23:00.000000000 -06:00',
      2                               'MM/DD/YYYY HH24:MI:SS.FF TZH:TZM' )
      3                AS TIMESTAMP WITH LOCAL TIME ZONE)
      4*   from dual
    SCOTT @ nx102 JCAVE9420> /
    CAST(TO_TIMESTAMP_TZ('12/8/200610:23:00.000000000-06:00','MM/DD/YYYYHH24:MI
    08-DEC-06 11.23.00.000000 AM
    Elapsed: 00:00:00.01
    SCOTT @ nx102 JCAVE9420> Justin

  • *ERROR* Hangcheck timer elapsed

    Hi,
    I'm using intel sandybridge graphics (xf86-video-intel 2.15.0) with linux 2.6.38.4. Whenever I run app that requires OpenGL(e.g. glxgears), I GPU hangs about every 3 seconds.
    dmesg shows:
    [   58.693676] [drm:i915_hangcheck_ring_idle] *ERROR* Hangcheck timer elapsed... blt ring idle [waiting on 6200, at 6200], missed IRQ?
    I googled and didn't find anything useful. I thought is was a bug and should be fixed in the future until today when I tried Ubuntu 11.04.
    When I boot to Ubuntu 11.04, glxgears ran perfectly, no GPU hangs no strange white striped or flicker (https://bugs.archlinux.org/task/23771)
    I noticed that ubuntu is using kernel 2.6.38 and xf86-video-intel 2.14.0.
    Anyone knows how come this can happen? or how to fix this?
    Thanks

    Falcata wrote:
    I was about to post a new topic about this, but it seems I don't need to.  I encountered this problem last night when I was converting my old server to a media system.  This is what lspci says about my server's GPU:
    00:02.0 VGA compatible controller: Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device (rev 01)
    Going to install kernel26-lts and see if that helps any
    You can try this setup: https://bbs.archlinux.org/viewtopic.php … 58#p937758

  • Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server)

    I am getting the error message, "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. (Microsoft SQL Server)". I am attaching the stored procedure. Can anyone see where the syntax may
    be causing this.
    USE [ReportData]
    GO
    /****** Object: StoredProcedure [PDI].[usp_MJTestTop10_Select] Script Date: 04/23/2015 10:35:43 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    --USE [ReportData]
    --GO
    --/****** Object: StoredProcedure [PDI].[usp_MJTestTop10_Select] Script Date: 04/23/2015 08:22:26 ******/
    --SET ANSI_NULLS ON
    --GO
    --SET QUOTED_IDENTIFIER ON
    --GO
    ALTER PROCEDURE [PDI].[usp_MJTestTop10_Select]
    @StartDate DATE,
    @EndDate DATE,
    @Location VARCHAR
    AS
    DECLARE @CalendarKey TABLE (
    Calendar_Key int,
    Organization_Key int,
    Day_Date DATETIME
    BEGIN
    INSERT INTO @CalendarKey
    SELECT C.calendar_key,
    O.Organization_Key,
    C.Day_Date AS DATETIME
    FROM pdi.PDI_Warehouse_952_01.dbo.calendar C,
    pdi.PDI_Warehouse_952_01.dbo.Organization O
    where @EndDate is not null
    and C.Day_Date BETWEEN @StartDate and @EndDate
    or @EndDate is null
    and C.Day_Date = @StartDate
    END
    SELECT CAST(C.Day_Date as DATE) as [Memo Date],
    --C.calendar_key,
    ISNULL(CAST(MBH.Transaction_Number as VARCHAR), 'Unknown') as [Memo Number],
    O.Site_id,
    O.Site_desc,
    --p.Product_Key,
    p.UPC as [UPC],
    (CAST(P.Department_ID as VARCHAR) + ' ' + CAST(P.Category_ID as VARCHAR) + ' ' + CAST(P.Sub_Category_Id as VARCHAR)) as [D C S],
    ISNULL(CAST(IPF.Vendor_Key as VARCHAR), 'Unknown') as [Vendor Code],
    --ISNULL(CAST(V.Vendor_Desc as VARCHAR), 'Unknown') as [Vendor Desc],
    ISNULL(P.Item_Desc, 'Unknown') as [Description],
    ISNULL(P.Size_Desc, 'Unknown') as [Size],
    ISNULL(RTrim(Cash.Cashier_Name), 'Unknown') as [Associate],
    ISNULL(CONVERT(INT, IIF.Beg_Inv_Qty, 0), '0') as [Old Qty],
    ISNULL(CONVERT(INT, IIF.End_Inv_Qty,0), '0') as [Adj Qty],
    ISNULL(CONVERT(INT, IIF.End_Inv_Qty - IIF.Beg_Inv_Qty, 0), '0') as [Dif Qty]
    FROM pdi.PDI_Warehouse_952_01.dbo.Item_Sales_Fact ISF
    INNER JOIN pdi.PDI_Warehouse_952_01.dbo.Product P ON ISF.Product_Key = P.Product_Key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Organization O ON ISF.Organization_key = O.organization_key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Item_Purchases_Fact IPF ON ISF.Product_key = IPF.Product_Key
    AND ISF.Organization_key = IPF.Organization_key
    AND ISF.Calendar_key = IPF.Calendar_key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Item_Inventory_Fact IIF ON ISF.Product_Key = IIF.Product_Key
    AND IIF.Product_Key = P.Product_Key
    AND ISF.Organization_key = IIF.Organization_Key
    AND ISF.Calendar_key = IIF.Calendar_Key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Calendar C ON ISF.calendar_key = C.calendar_key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Cashier Cash ON ISF.Organization_Key = Cash.Organization_Key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Cashier_Metric_Hourly_Dept_Snapshot CMH on Cash.Organization_Key = CMH.Organization_Key
    AND Cash.Cashier_Key = CMH.Cashier_Key
    AND ISF.Calendar_Key = CMH.Calendar_Key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.MarketBasket_Header MBH ON ISF.Calendar_Key = MBH.Calendar_Key
    AND ISF.Organization_Key = MBH.Organization_Key
    AND Cash.Cashier_Key = MBH.Cashier_Key
    LEFT JOIN pdi.PDI_Warehouse_952_01.dbo.Vendor V ON IPF.Vendor_Key = V.Vendor_key
    AND IPF.Calendar_Key = C.Calendar_Key
    LEFT JOIN @CalendarKey CK ON ISF.Calendar_Key = ck.Calendar_Key
    AND ISF.Organization_Key = CK.Organization_Key
    WHERE C.calendar_key = CK.Calendar_Key
    ORDER BY
    O.Location_ID,
    C.Day_Date,
    IPF.Vendor_Key,
    P.UPC,
    P.Size_Desc

    Some additional comments. 
    @Location VARCHAR
    Look closely at this.  How many characters can @Location contain?  You did not specify, so perhaps you think some appropriately large default value is used.  Guess again. You did a similar thing with cast (multiple times) - which is handled
    differently.  Don't be lazy.
    WHERE C.calendar_key = CK.Calendar_Key
    Go review the join to the CK table.  It is an outer join.  Yet you have included criteria in the where clause that requires a match in the unpreserved (@CalendarKey aka CK) table.  This effectively transforms that join from outer to inner.
    Was that intentional? Probably, but then you don't need to use an outer join
    FROM pdi.PDI_Warehouse_952_01.dbo.calendar C,
    pdi.PDI_Warehouse_952_01.dbo.Organization O
    Evolve.  We do not join in the where clause any longer.  You should be joining using join operators.  And perhaps more importantly, why do you need to dump a resultset into a table variable at all?  Note that your join is a cross join
    since there is no relationship between calendar and Organization - intentional? Given the rest of the logic, it seems that you don't really need to do this.
    ISNULL(CONVERT(INT, IIF.End_Inv_Qty,0), '0') as [Adj Qty],
    Go review the documentation for convert.  You supply a style, but does it do anything?  We don't know what datatype End_Inv_Qty is, but I assume it is numeric (and not float).  So what do you intend?  And you convert it to integer but
    use a character '0' in the isnull function.  Your lack of consistency can lead to issues that are difficult to find and resolve.
    CAST(C.Day_Date as DATE)
    Why are you doing this? You defined the column in your table variable as datetime.  You cast the value you use to populate this column to datetime.  I'm guessing that you only really care about the date portion.  The name you used for the
    column implies this.  So why bother with datetime in the first place?
    And one last suggestion. If you disallow the use of NULL for the @EndDate argument (simply supply the same value for both date arguments) you can simplify the logic that populates your table variable (or its replacement) and greatly eliminate the confusion
    and chance for errors that nullability requires.

  • How to convert server specific date string into client specific date object

    Hi developers,
    I have a very complex issue to convert the server date string format "EEE MMM dd HH:mm:ss z yyyy" into java.util.Date object and find the difference of the client machine date to represent the elapsed time
    The problem is the server time zone and client time zone are not unique and when I try to covert the server date which is in string format to date format using SimpleDateFormat class , I got the server time as 3:30 hours appended to it. The server time zone is in IST and Client time zone format is GMT+5:30 , the appended time of 3:30 hours created the confusion in calculating the elapsed time between the server started time and client requested time
    I went through all the sites but none of them were useful
    If any help to solve the above issue is appriciated
    please send the response with the same subject line
    Advance Thanks

    Why don't you just subtract from the server time the 3:30 hours (consult api of java.util.date) before comparing with the client date? Hard to see where's the problem...

  • Convert Calender to date with MM-DD-YYYY

    I want to convert calendar object to date with the format of DD-MM-YYYY
    How to do this?

    Calculating Java dates: Take the time to learn how to create and use dates
    Working in Java time: Learn the basics of calculating elapsed time in Java
    Formatting a Date Using a Custom Format
    Parsing a Date Using a Custom Format

Maybe you are looking for

  • How long does it take to get the code Mountain by email ?

    Hello, I bought my MacBook Pro end of June and I submitted my order form with everything attached (image of ticket and so on...). It's about one week I'm waiting for the code to download the OS X Mountain Lion... Before I got a mail telling me the ti

  • Can't order book with 1.5

    Last night I wanted to order a book (3 copies, actually). I thought it might be better to do this before upgrading to 1.5, but when I started the "Buy Book" process, Aperture put up a window with a strong recommendation to upgrade BEFORE ordering. OK

  • IPhone software update for officially unlocked version?

    Hi everybody, -This is my situation: I would like to purchase an iPhone 3G officially unlocked (From Italy)[MB496T/A].{some ones visiting} Would I be able to update the software? i dont mind about the warranty

  • HTML (Editor) region should scroll vertical only

    Hi, I have a HTML Editor . I want to restrict the width of it. I mean I want vertical scroll only, not horrizontal. For long sentences,it should go to next line after limit . Thnx in adv.

  • Karaoke text in Adobe After Effects cs4

    Hi, i need some help, how to make karaoke text in adobe after effects cs4? have any tutorial?