Problem with query issuing service

Hello

I had a problem with sub query with the cast function.
SQL>  SELECT
  2    CAST ( ( ( (COUNT (
  3    CASE
  4      WHEN ServiceRequest_ec.WasCaseClosed = 1
  5      THEN 1
  6    END) )* 100) / (COUNT (DISTINCT ServiceRequest_ec.case_id)) ) AS nvarchar) AS Average
  7     FROM ServiceRequest_ec
  8  INNER JOIN cases_ec
  9       ON ServiceRequest_ec.case_id = cases_ec.case_id
 10  INNER JOIN contacts_ec
 11       ON ServiceRequest_ec.contact_id = contacts_ec.contact_id
 12  INNER JOIN users_ec
 13       ON contacts_ec.user_id = users_ec.user_id
 14  INNER JOIN departments_ec
 15       ON contacts_ec.department_id = departments_ec.department_id
 16    WHERE 1                         = 1;
  END) )* 100) / (COUNT (DISTINCT ServiceRequest_ec.case_id)) ) AS nvarchar) AS Average
                                                                   *
ERROR at line 6:
ORA-00902: invalid datatype 


SQL> spool off
Any help appreciated reallly.

Thanks in advance

Published by: user512743 on December 8, 2008 03:40

I find a lot of difference in your script. Just run this part and let us know if it is running or not->

SELECT  CAST(
             (
              COUNT(
                     CASE
                       WHEN ServiceRequest_ec.WasCaseClosed = 1 THEN
                         1
                     END
                   ) * 100
              )/(
                  COUNT(
                         DISTINCT ServiceRequest_ec.case_id
                       )
                ) AS nvarchar2(30)
             ) AS Average
FROM ServiceRequest_ec
     INNER JOIN cases_ec
        ON ServiceRequest_ec.case_id = cases_ec.case_id
     INNER JOIN contacts_ec
        ON ServiceRequest_ec.contact_id = contacts_ec.contact_id
     INNER JOIN users_ec
        ON contacts_ec.user_id = users_ec.user_id
     INNER JOIN departments_ec
        ON contacts_ec.department_id = departments_ec.department_id
WHERE 1 = 1
GROUP BY contacts_ec.user_id,
         users_ec.UserName         ,
         users_ec.firstname        ,
         users_ec.lastname         ,
         contacts_ec.department_id ,
         departments_ec.name;

Maybe you run a partial query of much more complex query. And does not separate the two successfully. After you receive this error - I guess.

Just run my solution and let us know.

Kind regards.

LOULOU.

Tags: Database

Similar Questions

  • have a problem with my Windows Services.

    I have a problem with my Windows Services.
    Every time when I run the Windows Services window, I get a warning:

    One or more activex controls could not be displayed because that is:
    1. your current security settings prohibit running activex
    the controls on this page, or
    2. you have blocked an editor of one of the controls.
    for example, the page may not display correctly.

    The warning popup opens only when I click on the extended tab.
    The problem has nothing to do with the security of IE, because I can open pages with ActiveX controls on them and so.

    I installed the Spybot spyware/malware removal tool. Then uninstalled.
    I don't know if this is the cause of the problem. But I assume that it is.

    So, maybe someone faced the same problem and knows the cause for it.

    Thank you.

    Hi faisalzaman,

    Check out the link below to put on with similar problem and check if it helps.

    http://social.technet.Microsoft.com/forums/en-us/w7itprosecurity/thread/90c3202c-448B-42b7-ACF7-dab8dba7b000/

  • Update Windows problem with the Bits Service and error 0 x 80070057

    The service status: problem with the Bits Service

    Error 0 x 80070057

    Original title: Windows Update problems

    Hi Dexter,

    Can I know the KB # the update fails?

    What is the question pertaining to a specific or all update updates?

    What antivirus software you use on your computer?

    To resolve this problem, see the following article:

    Difficulty errors Windows Update corruption as 0 x 80070002 and 0 x 80070057

    Hope the helps of information. Get back to us with more information to help.

  • Problem with Toshiba authorized service providers

    I have a laptop Toshiba Satellite A300-17.

    Recently, I had the following problem: while the laptop was running normally, whenever I opened it I got a black screen (Please note that the output sound was normal). When I connected the laptop to an external monitor (VGA), I myself went to be normal for her and so I was able to work without any other problems.
    After a while, I decided to get the laptop for service providers authorized by Toshiba in Greece.

    They told me that the problem was the motherboard, that sounded really strange because I had no problem with starting. When I went to get the laptop on their part, I discovered that the computer cannot start.

    So I asked why this is happening and why it worked before and it doesn't work now.
    Their response was that my motherboard was "die slowly" and that they did not open the laptop to check what was wrong with her, but only an online diagnostic test.

    Of all the foregoing, I believe they have done something to my laptop and caused the problem with the motherboard. I tried to contact Toshiba Europe and inform them about the behavior of their authorized service providers by sending an e-mail in Germany ([email protected]), in the hope that they would do something in this regard. Unfortunately, I had no answer.

    Please note that I am a PhD student and my laptop is necessary for my research activity. All this delay has a major impact on my work.

    Who do I contact in order to bypass this?
    Is there anyone in the treatment of cases like that of Toshiba?
    Is it possible that a company like Toshiba just don't care about their customer satisfaction?

    How long should I wait before this problem is solved?

    Hello

    It of really hard to tell how much of the material could be faulty, but if the laptop does not start, then a serious problem of material is possible.
    You said that the internal screen was dark, but you could work with an external monitor attached to the laptop.

    > When I connected the laptop to an external monitor (VGA), I myself went to be normal for her and so I was able to work without any other problems

    Well, that means the motherboard and graphics card might be ok and that the internal display will be affected.
    However, only a technician of the laptop could provide more details, after the material has been checked, so I would say you should get in touch with the guys once more in order to get the extract.

    I found these contact data for the Greece page ASP from Toshiba:
    http://EU.computers.Toshiba-Europe.com/innovation/generic/ASP_SUPPORT/

    + Ideal Electronics S.A. +
    + www.toshiba-computer.gr+
    [email protected]+
    + P: + 30 2105 193 900 +.
    + F: + 30 2105 193 921 +.

    Good luck

  • Problems with Windows Vista Service pack 2: Code 8004402F; Code 80010108

    Well, I tried to download the SP2 for Vista Edition home premium, about a month ago and got the 2nd error code indicated. I recently tried again and got the first code listed. During the recent attempt, the achievement of the updated 3/3 but computer froze just after the restart and had to do a system restore.

    In addition, windows update cannot download updates... always says UNABLE

    And, I can't run/install programs downloaded such as to fix the windows update. I get a message saying "THE TEMP FOLDER IS ON A DRIVE that IS FULL or IS INACCESSIBLE. FREE UP SPACE ON THE DRIVE OR THE VARIFY THAT YOU HAVE PERMISSION TO WRITE TO THE TEMP FOLDER '

    I'm the administrator, I have more than enough free space on the disk, and I double checked that the permission is given to all temporary folders. Disk Cleanup is done frequently. SP1 is installed. I am running Trend Micro security and have tried with this option disabled.

    Help, please!

    Free unlimited installation and compatibility support is available for Windows Vista, but only for Service Pack 2 (SP2). This support, initially planned to end on November 26, 2009, has been postponed until February 26, 2010, so move on! Availability of support chat or messaging differs depending on your location. Some questions may require that more support for which he is advanced a charge.  Go to http://support.microsoft.com/oas/default.aspx?prid=13014&gprid=582034 & select appropriate category (i.e., download problem;) Installation problem; Problems after installing a service pack). ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Problem with the listening Service: Long delay beginning listener, intermittent connections

    I have problems to connect to my Oracle database.  I don't know what was the cause, but now when I connect to a database that has been working well for the past two years, I usually get an ORA-12541 error.

    I run lsnrctl status on the server and get a prinout like this:

    Copyright (c) 1991, 2010, Oracle.  All rights reserved.

    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST=dqaswn02) (PORT = 1521)))
    AMT-12541: TNS:no listener
    AMT-12560: TNS:protocol adapter error
    AMT-00511: no listener
    Windows 64-bit error: 61: unknown error
    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521)))
    AMT-12541: TNS:no listener
    AMT-12560: TNS:protocol adapter error
    AMT-00511: no listener
    Windows 64-bit error: 2: no such file or directory

    I also tried to manually stop the service through services.msc, then by restarting via lsnrctl start, but when I do this I get a very long delay (10 + minutes) before he comes back with something like:

    TNS-01153: failed to process the string: 0i

    I'm quite lost as to what is wrong.  I've been messing around with listener.ora, but I don't see anything difficult in there.  Here's a copy:

    listener.ora # Network Configuration file: E:\app\myc0714\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = E:\app\myc0714\product\11.2.0\dbhome_1)
    (= Extproc PROGRAM)
    (ENVS = "EXTPROC_DLLS=ONLY:E:\app\myc0714\product\11.2.0\dbhome_1\BIN\OraClr11.dll")
    )
    )

    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dqaswn02) (PORT = 1521))
    )
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1521))
    )
    )

    # ADR_BASE_LISTENER = E:\app\myc0714
    LOG_FILE_LISTENER = LISTEN PORT
    TRACE_LEVEL_LISTENER = SUPPORT
    TRACE_FILE_LISTENER = LISTEN PORT

    A few times during that time, I was able to connect to the server, via sqlplus, however, it took 10 minutes before the connection is online.  Once I'm connected, I can ask my paintings as expected, but I need an application to connect.

    If anyone has any ideas on what could be the problem, please let me know.

    In fact, there was another thing, I changed when I finally got it works, although I don't know if it was related or not.  In my folder with my track logs, I had a huge (> 4 GB) listener.log file.  I deleted this file right before that I ran the command netsh command to reset and then restarted.  This file was also a bit special, because it had not been updated since around the time that I first encountered this problem.  It seems to be updated on a minute by minute basis, now that I've removed the old.  Is there a problem with this file becomes too big?  My drive was not out of space, but it is very curious that this stopped file update on the same day as when I started having the problem and now works properly again.  I wish I had noted the exact time until I deleted it.

    Link:

    Problem of Listener.log & #8211; large file | Obtained & #039; s Blog

  • problem with query select in the search

    Hello

    Here I use MYSQL database and when I insertind to the database date, it saves as "2009-11-10 00:00:00 ' and when I used to do this show in dateformat as November 10, 2009".

    Here's the problem occurs, when I write a search like query

    Select recruitername, interviewdate, skillset
    details
    where interviewdate = #form.interviewdate #.

    I'm not a problem with the date. could u please help me how to solve this problem.

    Or, better yet, a with a type date.

    WHERE interviewdate =

  • LaserJet MFP M277dw Pro: problem with printing issue

    We have the model HP laserjet MFP M277dw, we love it, but have been a problem with what looks like small pink flies on one side of the paper when it is printed, is there a setting that turns off or what is the cause, thank you

    UPDATE: took MFP and was checked by techie printer, tried a new toner and does no differenct so he rang HP and they replaced the MFP, it was still under warranty

    Thanks to those who have tried to help

  • Problem with the internet service of blackBerry Smartphones

    Hi, I had my BB curve less than a month, so I'm still learning.  I can access internet for most sites, but the one that I want - I can not go beyond the main connection.  I am an AVON representative and want to be able to access my AVON site but when I connect, it just reloads the same page - doesn't give me any error messages or anything.  AT first, he said I had to activate Java script - I went to options and enabled the Jave script - but still no luck.  Does anyone have any suggestions.  I have no problem with other sites, but I have not tried all the others I actually connect.

    Thank you

    Sorry I took so long.

    I don't have to connect that I was checking to see if he had all the elements that would keep the BB to access the site.

    I can't speak to the internals.

    I would recommend a third party FREE application. It is called opera mini, another type of browser. It shows the page of the entire site and you can zoom in on what you want on the page. I had the chance to connect to sites on this

    App. I guess that a second reason for you would be especially in the search for the pages of products etc.

    Sorry I couldn't be more helpful. If you could please take a moment to solve this thread using the green check mark in the post that is closest to you to answer your question, I would appreciate it.

    Here is the link for Opera mini, go on your BB and download, be sure to allow all connections. Try it and see if it helps. If you need help, just open a thread and we will help you with it.

    Thank you

    http://www.operamini.com/download/

  • Problem with Assembly of Services Essbase servers

    Hi all

    I have download the installable required for Installation of Hyperion 11.1.2 but after selecting select by product, Essbase services 32-bit server is not selected. When I've highlighted that it is giving the message not found 'Assembly '. It only happens with Essbase Server services only. Rest are very good. I downloaded part 1 & 2 delivery Essbase. Do I need to download anything else outside of these? Pls help


    Thank you
    PVR

    Yes, you need additional content, like I said OPMN is a component of additional content and this is required for the installation of essbase.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • problems with windows and services updates

    Cannot install the update of security for Microsoft .NET Framework, Version 1.1 Service Pack 1 (KB929729) - I tried to download directly from the Microsoft Web site, but when it came to run the installer I tells me that "Windows Installer has stopped working", I looked in Services in administrative tools and looked at the parameters of Windows Installer But unlike other services, I was unable to start, pause, or restart...
    Also WMI Provider Host has stopped working, I get this Description of the problem.
    Problem event name: APPCRASH
    Application name: wmiprvse.exe
    Application version: 6.0.6002.18005
    Application timestamp: 49e01c05
    Fault Module name: kernel32.dll
    Fault Module Version: 6.0.6002.18005
    Timestamp of Module error: 49e037dd
    Exception code: c0000005
    Exception offset: 00004846
    The system version: 6.0.6002.2.2.0.768.3
    Locale ID: 2057
    Additional information 1: 8afb
    More information 2: c48e6a47e9306bdb7012bd981c4d771e
    3 more information: bc0e
    Additional information 4: 7bd357e4bcf267979a63c01b1ee70fc3
    ... when I click on "Check online for a solution (recommended)", Windows searches for a solution to the background, but this never seems to bear fruit because the message constantly.
    Would be happy to help with this, thanks in advance.

    Hello

    Hide updates in Windows Updates - HIDE (if they are still pending)

    How to hide or show an update of Windows Vista
    http://www.Vistax64.com/tutorials/72491-Windows-Update.html

    -----------------------

    Then check this:

    Start - type in the search box - Services - find at the top of the list, made a top - RUN AS ADMIN, RIGHT CLICK

    Windows install - service should normally be set to the stop SIGN and MANUAL - if you change - APPLY / OK

    -----------------------

    Then run this:

    How to reset the Windows Update components? -a Mr Fixit
    http://support.Microsoft.com/kb/971058

    ------------------------------------------------

    Then run this:

    http://support.Microsoft.com/kb/290301
    Description of the Windows Installer CleanUp utility
    The Windows Installer CleanUp utility deletes all files and registry settings associated with the configuration of Windows Installer of a program.
    Does NOT remove an application, allows you to re - install a.
    http://TechNet.Microsoft.com/en-us/magazine/2008.08.UtilitySpotlight.aspx

    Windows install 4.5 Redistributable
    http://www.Microsoft.com/downloads/details.aspx?FamilyId=5A58B56F-60B6-4412-95B9-54D056D6F9F4&displaylang=en

    Rob - bicycle - Mark Twain said it is good.

  • problems with the connectivity services and ePrint 310a

    I just got a HP 310a as a replacement for what said HP was a 210 a defective. The 210 a would not stay connected to my network and support HP gives up and sent me a gift card to buy a replacement.

    I've set up the replacement. He also had the problem of connectivity but other features wireless everything has worked well. I could print by e-mail to a dedicated e-mail address and printing via my ipod using HP iprint app.

    While he was trying to use the previous suggestions of support to solve the problem of connectivity, the printer now has lost its ability to connect to web services and I can't activate the features of eprint. "" When I try to connect to web services, I get an error message indicating that "web server problem" "problem connecting to the web server.

    I set up the printer with a manual address and that is where the problem started.

    Please, any suggestions how to get this resolved.

    Here's what I recommend:

    1 set a static IP address, but make sure that it is outside the range of your router's DHCP.  If your router uses the range (.2 a.254, reduce the a.2 a.200 beach or something and then assign the printer apart from this, comme.220.)

    2 the gateway address goes into the field of the bridge and the first DNS entry.  Do not fill in the second.  The IP Address of the gateway usually ends par.1

  • BlackBerry Smartphones Blackberry curve 9380 problem with the sos service

    Dear

    BBM

    I am from pakistan

    in 2013, I bought blackberry curve 9380 that it worked well without any problems.

    only 8 months before it shows the installation of the sos service fail.

    I updated a new os in it even it's show same problem so kindly give me the precise of the IDF solution so that I should use.

    model. 9380 curve

    PIN code. [removed personal information]

    BT MAC - 80 60 07 7 BB 20

    Made in Malasia

    It is a forum sponsored by BlackBerry user. I am a user like you.

    I do not understand "SOS service installation failed. What is installation of service in this context with SOS?

    I'm guessing that you mean that you are the only emergency service. I would have again assumed SIM card problem before the problem of the OS.

    Have you tried another SIM card in your BlackBerry and tried your SIM in another phone?

  • Service Windows wireless suddenly stopped working because of problem with the KeyIso service

    Description of the problem: Windows Wireless Services suddenly stopped working on my computer. What I have discovered so far that the problem is that the WLAN AutoConfig service does not work because of the failure of the function "KeyIso". The error message for the mentions "Error 126" KeyIso (the specified module could not be found). Any help to fix this would be appreciated. TDW

    Hello

    What is the antivirus installed on the computer program?

    KeyIso Description:

    The service provides insulation for private keys key processes and operations of such associated encryption required by the common criteria. The service stores and uses long term keys in a secure process in line with the requirements of the common criteria. It should normally be disabled, as otherwise, these cryptographic operations may fail.

    Looks like there could be a corruption with the wireless connection that you have added. You can perform the steps.

    Method 1:

    Try to manually start the wireless service, i.e. the WLAN AutoConfig service. To do this, connect to the computer as an administrator.

    a. Click Start, type services.msc and press enter.
    b. Locate the Autoconfiguration WLAN service, double-click to open its Properties window.
    c as. under the general tab, change the startup type to Automatic and click on the Start button.
    d. click on apply, then ok.

    Method 2:

    To resolve this problem, try using the tool (SFC.exe) System File Checker. To do this, follow these steps:

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

    Method 3:

    You can uninstall and reinstall the network card and check.

    a. click Start, type Device Manager in the Start search box and press enter.
    b. locate the network adapters and expand the same.
    c. Select the Wireless connection, right click and choose Uninstall.
    d. restart the computer, if prompted.

    Drivers should settle automatically after the computer restarts.

    Now you can install the latest network card drivers and see if that fixes the problem.

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Windows wireless and wired network connection problems
    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Hope this information helps. Response with status so that we can help you.

  • Problem with the search service on a Windows Server 2012 R2

    Hi all

    I'm having problems setting up my newly installed Server vCenter server.

    Everything seems to be installed properly, at least I got no error message and I am able to connect to the Web Client vSphere.

    However, I can't create a data center as the inventory does not display any server...

    Weird, isn't it?

    When I try to access to the https://localhost:7444 / lookupservice page, a message tells me that the service is not available.

    Is there something else to do here?

    Something else weird to me, a beginner in VMWare environments, is that although I'm loging as administrator, it seems that I have not at all privilege. For example, for roles see, access to licenses and so on.

    How I setting a user administrator 'real '?

    Do you think that my problem might be this question of privilege? And that I do not see any server in the inventory because my administrator user does not have the appropriate rights to view it?



    Thanks in advance for any help you can provide.


    Kind regards


    Jeremy

    OK Guyz... My bad.

    Actually, I connect with the user local administrator instead of the user [email protected].

    Now everything seems fine.

    Sorry for the inconvenience! ;-)

    Jeremy

Maybe you are looking for