Concatenate results SQL query and CASE use Report Builder Reporting Services

I need to concatenate the results from a SQL query that is using CASE.  The query is listed below.  I do not need permitsubtype but I need to concatenate the results from the permittype. 
I tried deleting the permitsubtype query and it would not run correctly.  Please see the query and diagram below.  Any help is appreciated.
select  PERMIT_NO
,(case when
  ISNULL(PERMITTYPE,'') = ''
  then 'Unassigned'
  else (select LTRIM(RTRIM(PERMITTYPE)))
  END) AS PERMITTYPE
,(case when
  ISNULL(PERMITSUBTYPE,'') = ''
  then 'Unassigned'
  else (select LTRIM(RTRIM(PERMITSUBTYPE)))
  END) AS PERMITSUBTYPE
 ,ISSUED
 ,APPLIED
 ,STATUS 
 ,SITE_ADDR 
 ,SITE_APN
 ,SITE_SUBDIVISION
 ,OWNER_NAME
 ,CONTRACTOR_NAME
 ,ISNULL(JOBVALUE,0) AS JOBVALUE
 ,FEES_CHARGED
 ,FEES_PAID
,BLDG_SF
from Permit_Main
where ISSUED between @FromDate and @ToDate

Hi KittyCat101,
As per my understanding, you used case when statement in the query, you do not need to display permitsubtype in the report, but when you tried to delete permitsubtype from the query, it could not run correctly. In order to improve the efficiency of troubleshooting,
I need to ask several questions:
“I tried deleting the permitsubtype query and it would not run correctly.” As we can see, it has no effect to delete permitsubtype from the query you provided, could you please provide complete sql query for the report?
Could you please provide detailed information about the report? I would be appreciated it if you could provide sample data and screenshot of the report.
Please provide some more detailed information of your requirements.
This may be a lot of information to ask for at one time. However, by collecting this information now, it will help us move more quickly toward a solution.
Thanks,
Wendy Fu

Similar Messages

  • List of SQL tables and attributes used in SSRS reports

    Hi,
    I have around 450-500 reports deployed in SSRS reporting server.
    All these reports are built on SQL from multiple databases, and these databases are having unnecessary tables and attributes.
    My requirement is to clean the unused tables and attributes from the databases. For this, I need the list of SQL tables and attributes used in these 450-500 SSRS reports.
    Is there any way to get this data?
    Regards,
    RK

    Hi RK,
    According to your description, you want to get a list of the tables and attributes used in all reports.
    In your scenario, you can query the ReportServer.dbo.Catalog table to get Report name, data source name, dataset name, and query used in the dataset with query below:
    WITH XMLNAMESPACES ( DEFAULT 'http://schemas.microsoft.com/sqlserver/reporting/2010/01/reportdefinition', 'http://schemas.microsoft.com/SQLServer/reporting/reportdesigner' AS rd )
    SELECT ReportName = name
    ,DataSetName = x.value('(@Name)[1]', 'VARCHAR(250)')
    ,DataSourceName = x.value('(Query/DataSourceName)[1]','VARCHAR(250)')
    ,CommandText = x.value('(Query/CommandText)[1]','VARCHAR(250)')
    ,Fields = df.value('(@Name)[1]','VARCHAR(250)')
    ,DataField = df.value('(DataField)[1]','VARCHAR(250)')
    ,DataType = df.value('(rd:TypeName)[1]','VARCHAR(250)')
    --,ConnectionString = x.value('(ConnectionProperties/ConnectString)[1]','VARCHAR(250)')
    FROM ( SELECT C.Name,CONVERT(XML,CONVERT(VARBINARY(MAX),C.Content)) AS reportXML
    FROM ReportServer.dbo.Catalog C
    WHERE C.Content is not null
    AND C.Type = 2
    ) a
    CROSS APPLY reportXML.nodes('/Report/DataSets/DataSet') r ( x )
    CROSS APPLY x.nodes('Fields/Field') f(df)
    ORDER BY name
    For more information, please refer to this similar thread:
    Extract metadata from report server database
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • SQL Query Too Large For Report Region

    Oracle Friends:
    I have a SQL query that is 24,000 characters long. APEX fails when I try to create a report using this query, probably because it is too long.
    I get an "ORA-01461: can bind a LONG value only for insert into a LONG column" after I paste it and try to go to the next page.
    Any ideas? I can't make my query any smaller without creating intermediate tables.
    Any help would be most appreciated.
    Regards,
    Rich Locus

    Hi,
    If possible, try to reduce the no. of characters from your SQL query. Ex. use shorter aliases etc in your query. Also, as suggested above, create some views which can form a part of your query and then use those views in your main query to reduce the total no. of characters.
    The report region source can take some limited no. of characters only. Exact figure is not known to me.
    Try the above suggestion and see if this works or not.
    Regards,
    Mangal

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • How To Use Reporting Services On SQL Server 2000 ?

    Hi all .
    Today , I has a issue .
    Normal , if the customer use SQl Server 2005 , it is no proplem , so if use SQL Server 2000 ,  Now , I want to use Reporting services on SQL Server 2000 , but , I am searching  on Internet , so I know , if I want to use SQL 2000 reporting server , I must have license of SQL server 2000 .
    is Every body  idea for this issue  ? .
    Please help me .
    Thanks alot .

    Ok ,anyway thanks alot ,.

  • I often use my iPhone to take video but the result is NTSC and I use PAL, how I can change? Can somebody help me? Thanks

    I often use my iPhone to take video but the result is NTSC and I use PAL, how I can change? Can somebody help me? Thanks

    My problem is when I transfer the movie on Final Cut for the assembly of the film, I know that I can convert with MPEG Streamclip but I would like to take my film directly on PAL. Is that possible? In the previous message I wasn't clear, I hope now I explained myself better. Thanks for help

  • Things to consider when removing from AD domain a SQL Server 2008 which includes Reporting Services

    Do any one have a link to a list of things to consider when removing from AD domain a SQL Server 2008 which includes Reporting Services, Analysis Services and Integration Services?
    I am taking from an Active Directory domain several servers with SQL 2008 and Reporting Services, Analysis Services and Integration Services. The server will stay on its own without association to any domain, the server will keep its IP address and
    the server will not change names.
    I have done some research and I got the basic steps including, removing the user accounts from the domain, changing the services accounts, changing jobs and databases from being owned by users from the domain. But...
    Are there other things in Reporting Services, Analysis Services and Integration Services internal databases that have an association with the domain AND that will fail after no longer being in the domain?
    I've heard of Reporting Services subscriptions failing when the domain user account is no longer there...Are there any other got ya's that any one has encountered?
    Please advice.
    Note: I am posting in this forum basically because of what I heard on Reporting Services, but it may be a better idea to post into a more broad forum such as SQL Server Migration section.
    Thanks beforehand
    Paulino

    Do any one have a link to a list of things to consider when removing from AD domain a SQL Server 2008 which includes Reporting Services, Analysis Services and Integration Services?
    I am taking from an Active Directory domain several servers with SQL 2008 and Reporting Services, Analysis Services and Integration Services. The server will stay on its own without association to any domain, the server will keep its IP address and
    the server will not change names.
    I have done some research and I got the basic steps including, removing the user accounts from the domain, changing the services accounts, changing jobs and databases from being owned by users from the domain. But...
    Are there other things in Reporting Services, Analysis Services and Integration Services internal databases that have an association with the domain AND that will fail after no longer being in the domain?
    I've heard of Reporting Services subscriptions failing when the domain user account is no longer there...Are there any other got ya's that any one has encountered?
    Please advice.
    Note: I am posting in this forum basically because of what I heard on Reporting Services, but it may be a better idea to post into a more broad forum such as SQL Server Migration section.
    Thanks beforehand
    Paulino

  • SQL Server cannot authenticate using Kerberos because the Service Principal Name (SPN) is missing, misplaced, or duplicated

    We are getting this below alert message, while using SCOM 2012 R2.  Anybody have any idea how to resolve this on the SQL box ?
    Thx...
    SQL Server cannot authenticate using Kerberos because the Service Principal Name (SPN) is missing, misplaced, or duplicated.
    Service Account: NT Service\MSSQL$SQLEXPRESS
    Missing SPNs:
    Misplaced SPNs: MSSQLSvc/mysqlbox.com:SQLEXPRESS - sqldbadmin
    Duplicate SPNs:

    To Fix this issue, You can check below links
    http://support.microsoft.com/kb/2443457/EN-US
    http://www.scomgod.com/?p=155
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"Mai Ali | My blog:
    Technical | Twitter:
    Mai Ali

  • Generate dynamic reports using sql query and send via mail

    Can anyone provide me the links to dynamically generate the sql query based reports and send it to Mail. it should be called from the scheduler program using PL/SQL

    suppose you have the query as
    spool myrep.txt
    select * from emp where rowid<3;
    spool off
    write the query in the emp.sql query at any directory like d:\sqljobs\emp.sql
    the call make a batch file like sndml.bat and write the following codes
    sqlplus scott/tiger@orcl @d:\sqljobs\emp.sql
    explorer mailto:[email protected] d"\sqljobs\myrep.txt
    or if you are using any mailing software then you can use that..

  • Can HTML-based reports be built in BLS via an SQL Query and XSLT?

    Hello xMII experts,
    I have already built a report in xMII which uses XSLT to provide group/sum totals in a web browser. However in a new project, the report must run at certain times and possibly when certain signals become true in the process.
    It appears that BLS is a good choice to achieve this and my proposed Transaction was:
    1. SQL Query Action(uses the same QueryTemplate as in xMII)
    2. XSLTransform Action on the resulting XML resultset (The .xsl file contains HTML which is the original used in xMII to produce the report there)
    3. HTML Loader action with the resulting output of the transformation
    I have now got some output in the resulting HTML file - however it omits all XSLT code - and I am left with an empty HTML shell but for a few images.
    This indicates that perhaps no SQL data was ever returned.
    I have therefore two questions:
    1. How can I check if the SQL returned data?
    2. Is it possible to deliver data to a HTML file directly after an XSLTransformation.
    Looking forward to your responses
    Best Regards
    Robert Sales

    Thank you for the replies.
    I am a little closer the result I need - however I think I need to explain what I had and what I need a little better.
    Before BLS
    1 xMII report page (.irpt extension) with two iCalendar applets (start/end date) and a set of buttons (1 for each report)
    Upon clicking on a button the two dates are passed into an .irpt file, and via a servlet an SQL QueryTemplate and a XSL DisplayTemplate are used to build the report.
    The HTML is embedded in the XSL file - thereby generating the report direct in the web browser.
    - This all works fine
    With BLS
    A transaction which uses a modified SQL QueryTemplate (no date parameters) passing the results to an XML file. This works.
    Now when I click on the button in my xMII screen the .irpt file is called with no Date parameters and the xAcute QueryTemplate called with the XSL DisplayTemplate. The irpt file has <html> and <body> tags with XSL file in the Servlet call providing the tables and data extraction from the XML.
    I have no additional HTML file so I placed the iframe tag inside the XSL file - but it refers to the .irpt file - this doesn't sound right!
    I do get a little output in the web browser but it still omits all XSLT code.
    One more point - The Transaction can be scheduled and run as required - but I need the entire report to created and stored for viewing at a later date. Will a servlet tag running inside an .irpt file achieve this?
    Sorry for the chaotic writing here - but I must leave the office.
    Regards
    Robert Sales

  • SQL query against tables on MS SQL Server and Oracle using Oracle BI

    Hi All
    I have two databases Oracle and MS SQL Server. I want to write a query statement which will retrieve data from both databases and publish this data into one report. That is I want to join/merge data from tables in both database into one report with one SQL Statement something like:
    Select o.F1,o.F2, m.F1,m.F2
    from
    table@oracleServer o,
    table@microsoftSQLServer m
    where o.F1=m.F1;
    Can Oracle BI Publisher do this?
    Basically I want to query simultaneously two heterogeneous data sources in one SQL statement. Is there such a tool? I don't want to build a warehouse by moving data from SQL Server into Oracle or vice-versa. I don't want to duplicate data. I want to be able to query data at its source via 1 SQL statement.
    How would one go about doing such a thing?
    Many Thanks
    Kubilay.

    Hi Matt and Thomas
    Many thanks for your replies.
    Yes I have to do the join. Even worse I have to write an Aggregate query like this!
    Select o.F1,o.F2, m.F1,m.F2, count(*)
    from
    table@oracleServer o,
    table@microsoftSQLServer m
    where o.F1=m.F1
    group by o.F1,o.F2, m.F1,m.F2;
    These are 2 different systems (hardware & software) which actually do the same job, they produce transactions for a common business entity. Kind of, both sell tickets for the same ABC ferry company.
    I can not put them side by side on the dashboard, as I need to aggregate the data and present it maybe in a Oracle BI Report for Accounting and Financial reconciliation purposes.
    The truth is, as it is. I can't change it, is too late.
    I have to device a way to harvest both systems as they are. I don't want to move around data. I thought looking at Oracle BI I could write SQL against multiple Data Sources. I am struggling to find a way. As it seems that it can "SQL query" 1 data source at a time.
    I have been hinted on another forum (OracleTURK) to use Oracle Transparent Gateways and Generic Connectivity. http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
    Shame, I have to pay licenses for OWB and Oracle Transparent Gateways. I thought DB vendors can do better. Why do I have to pay to access the other 50% of the market.
    I can understand the performance implications this might have. Because of it I might even be forced at the end to move data (ETL) into a separate database, slice it into partitions and manage it that way. Pitty because currenlty I only need one report out of these systems but seems like will be dear to get.
    Thank you for all your help.
    Kubilay

  • SQL ENTERPRISE: The edition of Reporting Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database

    The error below makes absolutely no sense! I'm using Enterprise Core...yet I'm being told I can't use remote data sources:
    w3wp!library!8!03/05/2015-19:08:48:: i INFO: Catalog SQL Server Edition = EnterpriseCore
    w3wp!library!8!03/05/2015-19:08:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: , Microsoft.ReportingServices.Diagnostics.Utilities.OperationNotSupportedException: The feature: "The edition of Reporting
    Services that you are using requires that you use local SQL Server relational databases for report data sources and the report server database." is not supported in this edition of Reporting Services.;
    Really? This totally contradicts the documentation found here:
    https://msdn.microsoft.com/en-us/library/ms157285(v=sql.110).aspx
    That article says remote connections are completely supported.
    ARGH! Why does this have to be so difficult to setup?!?

    Hi jeffoliver1000,
    According to your description, you are using Enterprise Core edition and you are prompted that you can’t use remote data sources.
    In your scenario, we neither ignore your point nor be doubt with what you say. But actually we have met the case before that even though the SQL Server engine is Enterprise but the reporting services is still standard. So I would recommend you to find the
    actual edition of reporting services you are using. You can find Reporting Services starting SKU in the Reporting Service logs ( default location: C:\Program Files\Microsoft SQL Server\<instance name>\Reporting Services\LogFiles). For more information,
    please refer to the similar thread below:
    https://social.technet.microsoft.com/Forums/en-US/f98c2f3e-1a30-4993-ab41-acbc5014f92e/data-driven-subscription-button-not-displayed?forum=sqlreportingservices
    By the way, have you installed the other SQL Server edition before?
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Returning 25th to 40th result of SQL query, do I use a cursor?

    I have a complex SQL query that returns ALL the results I am looking for. I would to be able to only return the Nth to Nth result, like just the 50th to 70th record counts (assuming there is a sort by in the statement so it always returns in the same order.)
    I thought of using a cursor and checking %ROWCOUNT and only returning the proper rows, but that seemed like it would be inefficient. I could do the same on my front end (PHP 4.0.6) relatively easily, but that would be a really inefficient way to retrieve 20 records from a query with 1000+ records returned.

    Thanks, the links were helpful.
    Since rowcount ignores my order by clause, I have attempted to find ways to overcome this. I have tried using the rowcount method by recreating my tables as index-orginized with an index on the column that I need to be ordered by. As a result of this, I have come accross two problems.
    1. then index does not seem to update the order when I update the column. The column being indexed is a date type. The values added are usually sysdate, so although new elements are added properly, updating old ones does not change their index position.
    2. I really need to access the items from most recent to oldest, thus desc. Since I am returning by rowcount, this makes it difficult. The following SQL is the best I can come up with and requires the output to be looped in reverse for display in the correct order:
    select postid, subject, to_char(lastmod, 'Month FMDD, YYYY HH')||':'||to_char(lastmod, 'MIam'), name from (select t.postid, t.subject, t.lastmod, r.name, rownum ro from forumtopic t, forumrooms r where t.roomid = '1000668' and t.roomid = r.roomid and r.useraccess = '1') where ro between ((select count(*) from forumtopic subt where subt.roomid = '1000668')-40) and ((select count(*) from forumtopic subt where subt.roomid = '1000668')-25);

  • Sql query and speed of result

    public List Get(String pid, String str, List ls) {
              List a = new Vector();
              List d = new Vector();
              pcl.addAll("num"));-----list contains numbers which are present in this column "num"
              ListIterator pc = d.listIterator();
              while (pc.hasNext()) {
                   String dt = (String) pc.next();
                   List world = new Vector();
                   world
                             .addAll(ABG());.............tThis method will extratct each row one at a time and i think this while is creating problem as it is taking one row at time.process it and again go to database.I am getting result in 10 minute .is there anyway to reduce this time.Number of rows in table 1000

    rashmi_007 wrote:
    1)ABG() method contains this statement
    stmt = con.createStatement();
                   rs = stmt.executeQuery("select " + ruuyuyuy
                             + " from tablename where ID='" + id + "' "); this result we get in original code one by one each rowTotally wrong. Network latency is killing you. It's the classic noob error.
    Learn how to write JOINs.
    2)1) Slow DB server.-mysql 5No
    2) Slow DB connection.-not sureNo
    3) RAM memory shortage.-1GBMore than enough.
    4) Poor indexed table.-NOT usedWrong. Your table should at least have a primary key.
    5) Poor SQL query.-is written aboveTotally wrong.
    6) Poor code logic.-that is the reson I also think.As every time adg method get a row and then process it ,then again it goes to fetch new row by calling adg.
    so what could be done to improve speed .thanksLearn how SQL works and write a JOIN.
    %

  • SQLEception using Complex SQL Query with Java Studio Creator2 Build(060120)

    I am evaluating Java Studio Creator2 for a WEB base application project that will be making SQL queries to an Oracle Database but I have stumble into a problem using complex SQL queries.
    I am getting an SQLException "org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: [sunm][Oracle JDBC Driver][Oracle]ORA-00923: FROM keyword not found where expected". I looks like it cut my sql.
    The SQL that I am trying to execute is
    Select part_name
    from table1, table2
    where table1.part_nbr = table2.part_nbr
    and table2.row_add_dt = (select max(table3.row_add_dt)
    from table3
    where table3.ser_part_id =table2.ser_part_id)
    This is a valid query that it is using 2 different selects to get a part number.
    If posible, point me to the best solution were I will be able to make complex SQL queries like the one above and bigger.
    Is there any way that I can read an SQL query file instead of inserting the SQL query string into the setCommand()?

    I have read that document looking for some anwsers on how to make this kind of query. If I try the query that I have above in the query editor ,the query editor will cut off from the last select that is between ().
    I beleave, there is a work around using the inner joint or outter join command. I will try them to see If I get the corrent result. If not, then I have to keep on asking for possible solutions.
    Anyway, someone in the Creator Team should take a note in adding something like a special criteria in the Add Query Criteria Box for cases like the one I have. The special criteria will be like using another select/from/where to get some result that will be compare.
    Girish, Are you in the Sun Creator Team?

Maybe you are looking for

  • Firefox had a problem and crashed. We'll try to restore your tabs and windows when it restarts.

    do not know what's going on but the Firefox crashing, and is still crashing, and crashing back again .. This problem is not resolved for a long time 'and I wonder why not fix this problem so far? These details. We're Sorry Firefox had a problem and c

  • Image field in an Oracle table

    I want to create a table STUDENT which will be able to contain the name, the first name, ..., and a PHOTO field, which will contains a photography of the student in JPEG format. I understand that I must use the BLOB datatype for this field, and I thi

  • No apps home screen, please.

    I, for a moment, had a very nice home screen free of any apps whatsoever. That is until I downloaded another app then my clean, app free home screen was replaced with what was on page 2 screen. Full of apps... What I had done to get all the default a

  • What does the 'other' mean in iTunes?

    I have a 16GB iPhone 4S and the 'other' takes up 7GB of my data, how can I get rid of it?!

  • How to write  sql query?

    create table test ( company varchar2(2), order_number number(4), item_id number(4), quantity number(8), item_desc varchar2(16) insert into test values ('A',1001,1,10,'apple'); insert into test values ('A',1001,2,20,'banana'); insert into test values