Store values of different data types into single database field

Hi Friends,
  I  have to store values of different data types(character, numeric, date, time,  text, etc) into a single database field(Char 80). Then read the same values and display it into ABAP Webdynpro report. 
Appreciate any ideas, examples, suggestions.
Thanks
JB

Hi,
Try like this:
data: txt1 type string,
      var1(1) type c,
      var2(1) type n,
      var3 like sy-datum,
      var4 like sy-uzeit.
parameters: a type c,
            b type n,
            c like sy-datum,
            d like sy-uzeit.
concatenate a b c d into txt1.
write txt1.
var1 = txt1+0(1).
var2 = txt1+1(1).
var3 = txt1+2(8).
var4 = txt1+8(8).
write: / var1,
       / var2,
       / var3,
       / var4.
Regards,
Bhaskar

Similar Messages

  • Concat different rows column into single row field

    Hi,
    I have a table tblSite which has SiteID and SiteInvestigator. Can I concat different row base on siteID.
    SiteID -- SiteInvestigator
    1 -- x
    1 -- y
    2 -- z
    2 -- x1
    3 -- x2
    Basicaly I want data look like this,
    sitid --siteinvestigator
    1 -- x,y
    2 -- z,x1
    3 -- x2
    I want to use only sql query or create a view to get data like this. No stored procedure please.
    Can somebody help?
    Regards,
    Vinay

    this example might be of help.
    SQL> select * from tab1;
    COL1             COL2 COL3             COL4
    Sofinummer          1 occupation          1
    Sofinummer          1 occupation          2
    Sofinummer          1 occupation          3
    Sofinummer          2 occupation          1
    SQL> select col1, col2,
      2         substr(replace(max(substr(sys_connect_by_path (col3||' '||
      3                                                        col4, '-'),2)),'-',' '),1,60)
      4         as col3
      5    from tab1
      6  start with col4 = 1
      7  connect by col4 = prior col4 + 1
      8  and prior col1 = col1
      9  and prior col2 = col2
    10  group by col1, col2;
    COL1             COL2 COL3
    Sofinummer          1 occupation 1 occupation 2 occupation 3
    Sofinummer          2 occupation 1
    SQL>

  • How to add different data types in Linked list?

    The basic idea is that I want to implement a linked list like the one which we generally implement in C. I need to store different data types in a single node. Is it possible to implement like this or I have to implement a linked list for each different data type?

    I have an application program in which there is a form. In this form there are different text fields in which data is to be inserted by the user. These data's will be inserted into the database. I want to hit the database only once. So I need to store these data in a data structure before I insert into the database. I think it will be easy for me to handle the data in a linked list if I can have different data types in a single node.
    Moreover, I think u're not getting my question. This pic will help u.
    http://img522.imageshack.us/img522/4500/sampler.jpg
    I'm not sure about that the code which u have written will have different data types in single node. I have to try that.
    And of course if anyone has any better idea than me, it will be very helpful.

  • Can we send the data into different data target from single datasource how

    Hai
    can we send the data into different data target from single datasource how ?

    Hi,
    Create the transformation for each target and connect through DTP if you are in BI 7.0
    If it is BW 3.5 create transfer rules and load it Info source and then different update rules for different targets then load it using IP.
    If you are speaking about loading data from R3 data source to multiple data sources in BI
    Then follow the below step.
    1)create init IP's and run the IP's with different selection to different DSO(With same selection it is not possible).
    2)Then you will have different delta queues for the same data source in RSA7
    3)Your delta loads will run fine to different data sources from same DS in R3.
    Hope this helps
    Regards,
    Venkatesh

  • How to store measurement data in a single database row

    I have to store time-data series into a database and do some analysis using Matlab later. Therefore the question might be more a database question rather than Diadem itself. Nevertheless I'm interested if anyone has some best practices for this issue.
    I have a database which holds lifecycle records for certain components of same nature and different variants. Depending on the variant I have test setups which record certain data. There is a common set of component properties and a varying number of environmental measurements to be included. Also the duration of data acquisition varies across the variants.
    Therefore having tables appears to be non-optimal solution for storing the data because the needed number of columns is unknown. Additionally I cannot create individual tables for each sample of a variant. This would produce to many tables.
    So there are different approaches I have thought of:
    Saving the TDM and TDX files as text respectively as BLOB
    This makes it necessary to use intermediate files.
    Saving the data as XML text
    I don’t know yet if I can process XML data in Matlab
    Has anybody an advice on that problem?
    Regards
    Chris

    Chris
    Sorry for the lateness in replying to your post. 
    I have done quite a bit of using a Database to store test results.  (In my case this was Oracle DB, using a system called ASAM-ODS)
    My 2 Cents:
    Three functions were needed by users for me.  1) To search and find the tests,  and  2)  To take the list of Tests and process the data into a report/output summary. 2) If the file size is large, then being able to import the data quickly into analysis tool speeds up processing.
    1) Searching for test results.  This all depends on what parameters are of value for searching.  In practice this is a smaller list of values(usually under 20), but I have had great difficulty getting users to agree on what these parameters are. They tend to want to search for anything.   The organization of the searching parameters has direct relationship to how you can search.   The NI Datafinder does a nice job of searching for parameters, so long as the parameter data are stored in properties of Channel Groups or Channels. It does not search or index if the values are in channel values.
    Another note: Given these are searchable parameters, it helps greatly if these parameters have a controlled entry, so that the parameters are consistent over all tests, and not dependent on free form entry by each operator. Searching becomes impossible if the operators enter dates/ names in wildly different formats.
    2) Similar issue exists if put values into databases. (I will use the database terms of Table and column(Parameter) and Row (instance of Data that would be one test record.)
    The sql select statement, can do fast finds, if store the searchable parameters in rows of a table. Where would have one row for each Test Record.   The files I worked with have more than 2000 parameters.   Making a table that would store all of these, and be able to search for all of these, makes a very large number of rows. I did not like this approach, as it has substantial maintenance time, and when changes are made, things get ugly quick.
    3)This is where having the file format be something that the analysis tool can quickly load up is beneficial.   Especially if the data files are large. In DIAdem's case, it reads TDM,TDMS files very quickly into the dataportal.   It can also read in the MDF or HDF files, but these are hierarchical structures that require custom code to traverse the information, and get the information into dataportal to use in Analysis /reporting. (Takes more time to read data, but have much more flexibility in the data structure than the two level tdm/tdms format.)
    My personal preferences
    I would not want to put the test data into a Table row. Each of the columns would be fixed and the table would be very wide in columns.
    >
    I personally like to put the test Data into a file, like TDMS, MDF, or HDF and then the database would have a entry for the reference to the attachment. The values that are in the database is just the parameters that are used for test Searching, either in datafinder or in sql commands in the user interface.
    Hopefully these comments help your tasks some.
    Respectfully,
    Paul
    tdmsmith.com

  • Not converting anything but get error: "Conversion failed converting varchar value 'X' to data type int"

    I have created the following trigger that fires instead of an UPDATE statement and copies the altered data over to an Audit table before proceeding with the requested UPDATE. After doing so, I wrote a simple UPDATE statement for testing:
    UPDATE Products
    SET ProductCode = 'XYZ 2014', ProductName = 'Special Edition Tamborine', ListPrice = 74.99, DiscountPercent = .5
    WHERE ProductID = 28;
    When I run this, I get the following message:
    Msg 245, Level 16, State 1, Procedure Products_UPDATE, Line 14
    Conversion failed when converting the varchar value 'X' to data type int.
    Here is my trigger:
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE; -- LINE 14
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    INSTEAD OF UPDATE
    AS
    DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
    @Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
    BEGIN
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM deleted;
    INSERT INTO ProductsAudit
    VALUES (@ProductCode, @CategoryID, @ProductCode, @ProductName, @ListPrice,
    @DiscountPercent, @DateUpdated);
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM inserted;
    UPDATE Products
    SET CategoryID = @CategoryID, ProductCode = @ProductCode,
    ProductName = @ProductName, Description = @Description,
    ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
    WHERE ProductID = (SELECT ProductID FROM inserted)
    END
    I am confused a bit by (1) the location of the error and (2) the reason. I have looked over my defined data types and they all match.
    Could someone offer a second set of eyes on the above and perhaps guide me towards a solution?
    Thank you.

    This is an issue in this trigger. It will work for single record updates alone. Also for your requirement you dont need a INSTEAD OF TRIGGER at all.
    You just need this
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE;
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    AFTER UPDATE
    AS
    BEGIN
    INSERT INTO ProductsAudit
    SELECT ProductID,
    CategoryID,
    ProductCode,
    ProductName,
    ListPrice,
    DiscountPercent,
    GetDate()
    FROM deleted;
    END
    Now, in your original posted code there was a typo ie you repeated the column ProductCode twice
    I think one should be ProductID which is why you got error due to data mismatch (ProductID is int and ProductName is varchar)
    see below modified version of your original code
    IF OBJECT_ID('Products_UPDATE') IS NOT NULL
    DROP TRIGGER Products_UPDATE; -- LINE 14
    GO
    CREATE TRIGGER Products_UPDATE
    ON Products
    INSTEAD OF UPDATE
    AS
    DECLARE @ProductID int, @CategoryID int, @ProductCode varchar, @ProductName varchar,
    @Description varchar, @ListPrice money, @DiscountPercent money, @DateUpdated datetime
    BEGIN
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM deleted;
    INSERT INTO ProductsAudit
    VALUES (@ProductID, @CategoryID, @ProductCode, @ProductName, @ListPrice,
    @DiscountPercent, @DateUpdated);
    SELECT @ProductID = ProductID, @CategoryID = CategoryID, @ProductCode = ProductCode,
    @ProductName = ProductName, @Description = Description, @ListPrice = ListPrice,
    @DiscountPercent = DiscountPercent, @DateUpdated = GetDate()
    FROM inserted;
    UPDATE Products
    SET CategoryID = @CategoryID, ProductCode = @ProductCode,
    ProductName = @ProductName, Description = @Description,
    ListPrice = @ListPrice, DiscountPercent = @DiscountPercent
    WHERE ProductID = (SELECT ProductID FROM inserted)
    END
    I would prefer doing it as former way though
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Join columns of different data types

    Can i join two columns of different data types in a single statement. Is there any cast or convert statement
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO.
    Here PARTNER_GUID is Raw 16 and PARTNER_NO is Char 32, the query is not returning any rows.
    Thanks
    Akila.R

    Hi!
    Basically we can say, you can't join them, but you might try this way:
    SELECT B~PARTNER AS RESP_GROUP
    FROM BUT000 AS B
    INNER JOIN CRMV_LINKPARTNER AS C ON BPARTNER_GUID = CPARTNER_NO(16).   "add
    (16)
    Or an other version
    C~PARTNER_NO+16(16)   "depends on, where is the real number stored
    Regards
    Tamá

  • Saving cluster of different data types to a file

    Hi,
    I use LV 8.6 SDK. I need to save clusters of different data types to a file on a disk, row by row.
    To be specific: I have a program that performs various investigations on a signal collected by DAQmx. Each time the quality of the signal is not in a specified boundaries, i get an indication. It is a cluster of time stamp, string, dbl, and Boolean. The program is supposed to run for few weeks in a row so there can be a lot of these indications. I expect to have around 200 000 rows a week (Altogether, divided into several groups).  
    I thought about TDMS but I am not able to save such a cluster. And I would like to save it as tdms cause i could divide the data to different groups. I also thought about data base but that would be the first time i use db and I really do not  have time to learn that now.
    I know it is possible to change some of the data types to others, ex Boolean to 0-1, but i need a string and a time stamp there. 
    Can someone advise me which data format should I use? Which one is the best one in this situation?
    Thanks in advance
    handre

    If you do not need to access data from another application (other than Labview) you can just save it as a binary file.
    It is the best choice (for me).
    I made an example with one cluster. You can replace that with an array of clusters, of that data type.
    Attachments:
    Example_VI_BD.png ‏2 KB

  • How to Get Default Value of a Data Type in SQL Query.

    Hi all,
    I am creating a procedure which will take input the table name and Column Name.
    In the Output i would like to have the data type and default value of that data type which will be used by a another procedure to blank the selected column in the database.
    I tried with SET NULL on the column but as the database is of navision the table have property set to NOT NULL.
    Here is what i have done till now.
    Create Procedure Get_Column_type
    @parm_table_name nvarchar(200),
    @parm_column_name nvarchar(20),
    @parm_result nvarchar(20)OUTPUT
    AS
    BEGIN 
    select @parm_result =
    DATA_TYPE from INFORMATION_SCHEMA.COLUMNS IC
    where TABLE_NAME = '[' + @parm_table_name +']' and COLUMN_NAME = '[' + @parm_column_name + ']'
    END
    GO
    Now instead on write a case statement for so many data types in SQL, i was thinking is it possible someway that above procedure also returns the default value which i can set in another procedure.
    Let me know if its possible or not? Thanks in advance.

    Do you looking for something like this?
    create table t10 ( c int default 1)
    SELECT so.name AS table_name, 
              sc.name AS column_name, 
              sm.text AS default_value
         FROM sys.sysobjects so
         JOIN sys.syscolumns sc ON sc.id = so.id
    LEFT JOIN sys.syscomments SM ON sm.id = sc.cdefault
        WHERE so.xtype = 'U' 
          AND SO.name = 't10'
     ORDER BY so.[name], sc.colid
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5

     
    Hi All,
    I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
    Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
    My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
    My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
    Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
    SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
    FROM (SELECT CASE Isnumeric(
    accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
    WHEN 1 THEN Cast(
    fact_highweedsandgrassdetails.vendorinvoiceamount AS
    VARCHAR(
    10))
    END AS
    Total_Dollar_Amount,
    fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township AS
    CaseTownship,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag AS
    CaseReferredToLegalFlag,
    fact_casedetails.macinitiatedflag AS
    CaseMACInitiatedFlag,
    fact_casedetails.conversionstatusdesc AS
    CaseConversionStatusDesc,
    fact_casedetails.assignedstaff AS
    CaseAssignedStaff,
    fact_casedetails.completedstaff AS
    CaseCompletedStaff,
    fact_casedetails.closedbystaff AS
    CaseClosedByStaff,
    fact_casedetails.initiator AS
    CaseInitiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    DECIMAL(6, 2))
    AS
    DaysOpen,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursOpenToMow,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursAssignedToMow,
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END AS
    NumberComplete,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate IS
    NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate
    <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHoursOLD,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHours,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
    Assigned_Department_Staff,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
    'HWG', 0)
    , '-', 0)) AS compliancejoin,
    fact_highweedsandgrassdetails.maccomments AS Expr1,
    dbo.dim_highweedscensustracts.b1_census_tract
    FROM dbo.fact_highweedsandgrassdetails
    INNER JOIN dbo.fact_casedetails
    ON fact_highweedsandgrassdetails.casenumber =
    fact_casedetails.casenumber
    INNER JOIN dbo.dim_highweedscensustracts
    ON fact_highweedsandgrassdetails.casenumber =
    dbo.dim_highweedscensustracts.casenumber
    GROUP BY fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag,
    fact_casedetails.macinitiatedflag,
    fact_casedetails.conversionstatusdesc,
    fact_casedetails.assignedstaff,
    fact_casedetails.completedstaff,
    fact_casedetails.closedbystaff,
    fact_casedetails.initiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    fact_highweedsandgrassdetails.vendormoweddatetime,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate
    IS NOT NULL
    AND
    fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE
    fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)),
    Cast(Datediff(ss,
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN
    ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(18, 2)) * 60,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]'),
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(
    Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
    , '-', 0)),
    fact_highweedsandgrassdetails.maccomments,
    dbo.dim_highweedscensustracts.b1_census_tract) AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
    ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    ASC
    SV

    I just counted the columns from the top:
    1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
    I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
    I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
    might be staring on the wrong column.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 6.

    Hi All,
    I'm still struggling with the same cube and this is my 3rd post and once i fix some thing the other breaks. Please forgive me. When i process my cube i'm getting the error:
    Errors in the back-end database access module. OLE DB was unable to convert a value to the data type requested for column 5.
    My question is when the error says column 5 (is it the column 5 in the DSV?) or is it the column 5 in the DIMENSION list?
    My next question is the DSV Query works perfectly fine , so why this error in cube? This is what i have in the query in DSV.
    Please need help. In the below query both the column 5 (ArEASSIGNED TO VENDOR) in the CUBE and underlying table have the same data type and length VARCHAR(4000). Why is the process failing still?
    SELECT [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_0],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingsector]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_1],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseclosedflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_2],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casehasvendorinfo]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_3],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_4],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_5],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassignedtovendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_6],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentvendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_7],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoiced]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSInvoiced0_8],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatus]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_9],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casecloseddateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_10],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assignedtovendordateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_11],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_12],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[currentassigneddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_13],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[mowingduedateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_14],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendormoweddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_15],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[captypename] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_16],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetype] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseType0_17],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumbersubgroup] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_18],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casetownship] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_19],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casestatus] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseStatus0_20],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseopendateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_21],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casereferredtolegalflag]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_22],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casemacinitiatedflag] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_23],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseconversionstatusdesc]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_24],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reasonforinvestigation] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_25],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[investigationopendateid]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_26],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[receiveddateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_27],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[assigned_department_staff]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_28],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[caseinitiator] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_29],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendorinvoiceamount] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_30],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[inspection_result] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_31],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[reason_for_complaint] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_32],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[vendor_action] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_33],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[complaint_source] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_34],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[contractcompliancevendor]
    AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_35],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[invoicedstatusdateid] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_36],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_complaint_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_37],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[date_of_inspection_id] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_38],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[casenumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSCaseNumber0_39],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[parcelnumber] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS0_40],
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[row_index] AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTSROW_INDEX0_41]
    FROM (SELECT CASE Isnumeric(
    accela_staging.dbo.fact_highweedsandgrassdetails.vendorinvoiceamount)
    WHEN 1 THEN Cast(
    fact_highweedsandgrassdetails.vendorinvoiceamount AS
    VARCHAR(
    10))
    END AS
    Total_Dollar_Amount,
    fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township AS
    CaseTownship,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag AS
    CaseReferredToLegalFlag,
    fact_casedetails.macinitiatedflag AS
    CaseMACInitiatedFlag,
    fact_casedetails.conversionstatusdesc AS
    CaseConversionStatusDesc,
    fact_casedetails.assignedstaff AS
    CaseAssignedStaff,
    fact_casedetails.completedstaff AS
    CaseCompletedStaff,
    fact_casedetails.closedbystaff AS
    CaseClosedByStaff,
    fact_casedetails.initiator AS
    CaseInitiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    DECIMAL(6, 2))
    AS
    DaysOpen,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursOpenToMow,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE
    (fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime)) AS
    NUMERIC(9, 2))
    * 24 AS
    HoursAssignedToMow,
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END AS
    NumberComplete,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate IS
    NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate
    <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHoursOLD,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)) * 24 AS
    AbatementDurationHours,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]') AS
    Assigned_Department_Staff,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(Replace(fact_highweedsandgrassdetails.casenumber,
    'HWG', 0)
    , '-', 0)) AS compliancejoin,
    fact_highweedsandgrassdetails.maccomments AS Expr1,
    dbo.dim_highweedscensustracts.b1_census_tract
    FROM dbo.fact_highweedsandgrassdetails
    INNER JOIN dbo.fact_casedetails
    ON fact_highweedsandgrassdetails.casenumber =
    fact_casedetails.casenumber
    INNER JOIN dbo.dim_highweedscensustracts
    ON fact_highweedsandgrassdetails.casenumber =
    dbo.dim_highweedscensustracts.casenumber
    GROUP BY fact_highweedsandgrassdetails.casenumber,
    fact_highweedsandgrassdetails.row_index,
    fact_highweedsandgrassdetails.mowingsector,
    fact_highweedsandgrassdetails.caseclosedflag,
    fact_highweedsandgrassdetails.casecloseddateid,
    fact_highweedsandgrassdetails.maccomments,
    fact_highweedsandgrassdetails.lastfeeinvoicedateid,
    fact_highweedsandgrassdetails.casehasvendorinfo,
    fact_highweedsandgrassdetails.mowingstatus,
    fact_highweedsandgrassdetails.receiveddateid,
    fact_highweedsandgrassdetails.assignedtovendordateid,
    fact_highweedsandgrassdetails.assignedtovendor,
    fact_highweedsandgrassdetails.reassigneddateid,
    fact_highweedsandgrassdetails.reassignedtovendor,
    fact_highweedsandgrassdetails.currentvendor,
    fact_highweedsandgrassdetails.currentassigneddateid,
    fact_highweedsandgrassdetails.mowingduedateid,
    fact_highweedsandgrassdetails.vendormoweddateid,
    fact_highweedsandgrassdetails.invoiced,
    fact_highweedsandgrassdetails.invoicedstatus,
    fact_highweedsandgrassdetails.invoicedstatusdateid,
    fact_highweedsandgrassdetails.vendorinvoicenumber,
    fact_highweedsandgrassdetails.vendorcomments,
    fact_casedetails.captypename,
    fact_casedetails.casenumbersubgroup,
    fact_casedetails.casetype,
    fact_casedetails.township,
    fact_casedetails.casestatus,
    fact_casedetails.caseopendateid,
    fact_casedetails.referredtolegalflag,
    fact_casedetails.macinitiatedflag,
    fact_casedetails.conversionstatusdesc,
    fact_casedetails.assignedstaff,
    fact_casedetails.completedstaff,
    fact_casedetails.closedbystaff,
    fact_casedetails.initiator,
    fact_casedetails.reasonforinvestigation,
    fact_casedetails.primaryaddress,
    fact_casedetails.parcelnumber,
    fact_highweedsandgrassdetails.vendormoweddatetime,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.receiveddatetime,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.assignedtovendordate,
    COALESCE (
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.recordimportdatetime))
    AS
    NUMERIC(9, 2)),
    CASE
    WHEN mowingstatus = 'Mowed'
    OR mowingstatus = 'Closed' THEN 1
    ELSE 0
    END,
    fact_highweedsandgrassdetails.recordimportdatetime,
    fact_casedetails.macsiebelnumber,
    fact_highweedsandgrassdetails.mowingduedate,
    fact_highweedsandgrassdetails.vendormoweddate,
    fact_highweedsandgrassdetails.lastfeeinvoicedate,
    fact_highweedsandgrassdetails.investigationopendatetime,
    fact_highweedsandgrassdetails.investigationopendate,
    fact_highweedsandgrassdetails.investigationopendateid,
    Cast(Datediff([day],
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    ( vendormoweddatetime IS NOT NULL
    AND vendormoweddatetime <=
    fact_highweedsandgrassdetails.casecloseddate ) THEN
    fact_highweedsandgrassdetails.vendormoweddatetime
    ELSE
    CASE
    WHEN (
    fact_highweedsandgrassdetails.casecloseddate
    IS NOT NULL
    AND
    fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime )
    THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE
    fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(9, 2)),
    Cast(Datediff(ss,
    fact_highweedsandgrassdetails.investigationopendatetime,
    CASE
    WHEN
    COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate) IS
    NOT NULL THEN COALESCE (vendormoweddatetime,
    fact_highweedsandgrassdetails.casecloseddate)
    ELSE
    CASE
    WHEN
    ( fact_highweedsandgrassdetails.casecloseddate IS NOT NULL
    AND fact_highweedsandgrassdetails.casecloseddate <=
    fact_highweedsandgrassdetails.recordimportdatetime ) THEN
    fact_highweedsandgrassdetails.casecloseddate
    ELSE fact_highweedsandgrassdetails.recordimportdatetime
    END
    END) AS NUMERIC(18, 2)) * 60,
    fact_casedetails.assigneddepartment,
    COALESCE (fact_casedetails.assignedstaff, '[null]')
    + '/'
    + COALESCE (fact_casedetails.assigneddepartment, '[null]'),
    fact_highweedsandgrassdetails.casecloseddate,
    fact_highweedsandgrassdetails.receiveddatetime,
    fact_highweedsandgrassdetails.assignedtovendordate,
    fact_highweedsandgrassdetails.vendorinvoiceamount,
    fact_highweedsandgrassdetails.invoicedstatusdate,
    fact_highweedsandgrassdetails.complaint_source,
    fact_highweedsandgrassdetails.inspection_result,
    fact_highweedsandgrassdetails.reason_for_complaint,
    fact_highweedsandgrassdetails.contractcompliancevendor,
    fact_highweedsandgrassdetails.vendor_action,
    fact_highweedsandgrassdetails.date_of_complaint_id,
    fact_highweedsandgrassdetails.date_of_inspection_id,
    CONVERT(INT, Replace(
    Replace(fact_highweedsandgrassdetails.casenumber, 'HWG', 0)
    , '-', 0)),
    fact_highweedsandgrassdetails.maccomments,
    dbo.dim_highweedscensustracts.b1_census_tract) AS
    [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS]
    ORDER BY [High_x0020_Weeds_x0020_and_x0020_Grass_x0020_FACTS].[compliancejoin]
    ASC
    SV

    I just counted the columns from the top:
    1) compliancejoin, 2) mowingsector, 3) caseclosedflag, 4) casehasvendorinfo, 5) mowingstatus, 6) assignedtovendor.
    I see now that your subject line talks about column 6, but you say column 5 in body of your original post.
    I don't know anything about cubes, but apparently there is some mapping problem when you run it from SSAS. (I assume it is SSAS, a part of the product I'm entirely ignorant of.) I figured that if you had got tripped by the zero-based numbering, you
    might be staring on the wrong column.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Same Input name with different data type cause the reflection exception

    I have a proxy contains couple RFCs. Two RFCs contain an argument named IN_COMPANY_CODE with data type of ZTRE_FX_BUKRSTable. Another RFC contains the same argument name of IN_COMPANY_CODE but hold different data type (String). All RFCs are in the same proxy. Complie and build the application with no issue.
    But when I ran the RFC, it generates the reflection exception below:
    Method SAPProxy1.Z_F_Tre_R_Pre_Trade_Fx can not be reflected. --> There was an error reflecting 'In_Company_Code'. > The XML element named 'IN_5fCOMPANY_--5fCODE' from namespace '' references distinct types System.String and MSTRFOREX.ZTRE_FX_BUKRSTable. Use XML attributes to specify another XML name or namespace for the element or types.
    I realize the conflict introduced by the same name with difference data type. But I would like to know if this is fixable as a bug or if there is any best practice and/or some manual intervention to make it work.

    Please install fix from OSS note 506603. After this, right-click .sapwsdl file and select "Run custom tool".

  • How to read a file with value of RAW data type? Please help

    Hi Experts,
       I  have a file with RAW data like DE864E48833BFFF1B805001CC4EF4BFA
       I am using GUI_UPLOAD.
       But this FM is throwing error.
       I tried by giving FILETYPE as ASC. The output internal table for this FM contains a field of type c size 32.
       Now it is able to read the file but I want to assign this value to a RAW data type variable.
       This it is unable to do. How to convert the char value to RAW data type?
    Please help!
    Thanks
    Gopal

    Hi,
    The documentation for the function module contains an example for RAW upload.
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.

  • Conversion failed when converting the varchar value 'undefined' to data typ

    Conversion failed when converting the varchar value 'undefined' to data type int.
    hi, i installed oracle insbridge following the instruction in the manual. in rate manager, when i tried to create a new "Normal rating" or "Underwriting", im getting the following exception
    Server Error in '/RM' Application.
    Conversion failed when converting the varchar value 'undefined' to data type int.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value 'undefined' to data type int.
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [SqlException (0x80131904): Conversion failed when converting the varchar value 'undefined' to data type int.]
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
    System.Data.SqlClient.SqlDataReader.HasMoreRows() +157
    System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +197
    System.Data.SqlClient.SqlDataReader.Read() +9
    System.Data.SqlClient.SqlCommand.CompleteExecuteScalar(SqlDataReader ds, Boolean returnSqlValue) +50
    System.Data.SqlClient.SqlCommand.ExecuteScalar() +150
    Insbridge.Net.Fwk.DAO.DataAccess.ScalarQuery(String connectionString, String command, Transaction transType, Object[] procParams) +110
    [Exception: Cannot Execute SQL Command: Conversion failed when converting the varchar value 'undefined' to data type int.]
    Insbridge.Net.Fwk.DAO.DataAccess.ScalarQuery(String connectionString, String command, Transaction transType, Object[] procParams) +265
    Insbridge.Net.Fwk.DAO.SqlProcessor.ExecuteScalarQueryProc(String subscriber, String datastore, String identifier, String command, Transaction transType, Object[] procParams) +101
    Insbridge.Net.Fwk.DAO.SqlProcessor.ExecuteScalarQuery(String subscriber, String identifier, String command) +22
    Insbridge.Net.RM.IBRM.ExeScalar(String cmd, Object[] paramsList) +99
    Insbridge.Net.RM.Components.Algorithms.AlgEdit.Page_Load(Object sender, EventArgs e) +663
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    my insbridge versions are as follows
    IBRU 4.0.0 Copyright ©2010, Oracle. All rights reserved. - Version Listing
    RMBUILD.DLL 4.0.0.0 (x86)
    SRLOAD.DLL 3.13.0 (x86)
    IBRM v04.00.0.17
    IB_CLIENT v04.00.0.00
    RM.DLL 4.00.0 (x86)
    IBFA 3.0.2
    OS: Windows Server 2003
    DB: Sql Server 2008
    Browser: IE8
    how do i solve this, please help

    This is an error due to conversion failed from character string to int datatype. Infact, the table column contains "NO" value which you are trying to convert to Int/SUM which is illegal. Without your code and table structure, its difficult to pinpoint your
    actual issue. But check, all columns for value "NO". 

  • Explain me briefly about evaluation order.As per my knowledge it show data type order.but I have different data type in same diemension ex:account- acc_001 is smart list data type.account-ac_002 is percentage.So fot this i will accont dim in evaluation or

    Explain me briefly about evaluation order.As per my knowledge it show data type order.but I have different data type in same dimension ex:account->acc_001 is smart list data type.account-ac_002 is percentage.So fot this i will accont dim in evaluation order.What going can any one explaining brifly ?

    2786712 wrote:
    thanks John for reply.If you dont mine can you explain clearly with example and screenshot.
    @John: You got a task
    Here you go: Hyperion Planning and More...

Maybe you are looking for

  • Special characters are changed to question marks

    I'm using SQL developer 3.107 for unit testing. In a particular unit test, the expected result is a sentence (varchar2) with a special character (ë). But when I save the result, SQL developer changes the character to 2 question marks. And as a result

  • How to transfer iPhoto pics?

    I just can't seem to transfer my Iphoto pics and videos from my macbook pro to my new 5C Iphone? I know Itunes is somehow involved, but i can't make it work. Help?????   :-)

  • Business Area in header level of sales order

    hi Gurus i have one query that the szystem dont take the business area automaically(default) on header level whts the setting oftha i have already assigned the business are4 to Sales Are & Plant & division too and taken the rul 3 for that............

  • Opening links in tabs

    Is there no way to set a preference so that clicking on a link on a webpage in Safari opens the linked page in a new tab instead of a new window without holding down the command key?

  • Is-it possible to transfer a movie from an iPad to a friend's iPad ?

    Good morning from Paris (France), When you buy a DVD, you can lend or give it to somebody else. Adter lokking a movie, it's a pity to keep it just for myself, closed in mu iPad... >>> do you know if it would be possible to transfer a movie from an iP