The data types varchar and varchar are incompatible in the subtract operator

Hi ;
I want to fetch values  6,903,00  format ,my query is ;
SELECT CONVERT(varchar(50), CONVERT(money,SUM(DEBIT)),1) AS DEBIT ,CONVERT(varchar(50), CONVERT(money,SUM(CREDIT)),1),AS
CREDIT CONVERT(varchar(50), CONVERT(money,SUM(DEBIT)),1) - CONVERT(varchar(50), CONVERT(money,SUM(CREDIT)),1) AS BALANCE
FROM TABLE
it was get error :  The data types varchar and varchar are incompatible in the subtract operator.
I want to Show result ;
DEBIT         -          CREDIT            -    BALANCE
6,903,00              4,387.24             2,515.76
Thanks in advance

You have to do the subtraction with the MONEY data type (prior to covert-ing).
Starting with SQL Server 2012, you can use the FORMAT command:
https://msdn.microsoft.com/en-us/library/hh213505.aspx
Kalman Toth Database & OLAP Architect
SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014
We have to use SQL 2005 due to licensing issue .

Similar Messages

  • The data type of InfoObject 0ORGUNIT is incompatible with field 0ORGUNIT

    I am trying to create a DataSource in BW to load the organizational hierarchy from HR R/3 to BW.  I get the message "The data type of InfoObject 0ORGUNIT is incompatible with field 0ORGUNIT," 
    Our BW version is 3.5; the version of HR R/3 is SAP ECC 6.0.
    I'm not sure what this message means but if I continue to click OK, I get transfer structures for the org attributes and hierarchies but not the text.  The key to the text is 60 characters.  Shouldn't the key be the org unit, which is in format NUMC 8?
    I was able to create this DataSource last summer, when HR was in a different version (4.6?) with no issues. Does anybody have any idea what's wrong and what I can do about it?
    Thanks!

    Would be nice if you could share the resolution they found,
    since that might help other people as well.
    For instance, me.... as we face exactly the same problem at the moment !!
    Ch

  • Help-Task not found - Please check the Task Type, Name and Location are cor

    HI all,
    i have upgraded my owb from version 11gr1 to 11gr2. the installation is complete and all my mappings and objects are imported successfully.
    i was able to execute the mappings using the sql code:
    @/oracle/product/11.2.0/owb/rtp/sql/sqlplus_exec_template.sql
    by logging into sqlplus as the user in whose schema mappings are deployed.
    hOwever, suddenly i am getting the error since sometime back - not sure what might have happened or what might have gone wrong. can someone please help me understand what might be wrong - how to decode this?
    Here is my error:
    @/oracle/product/11.2.0/owb/rtp/sql/sqlplus_exec_template.sql
    Role set.
    Enter value for 1: WSODS
    Call completed.
    Enter value for 2: ODS_SCHEMA
    Enter value for 3: PLSQLMAP
    Enter value for 4: MAPPING_1
    Enter value for 6: ","
    Enter value for 5: ","
    Stage 1: Decoding Parameters
    |  location_name=ODS_SCHEMA
    |  task_type=PLSQLMAP
    |  task_name=MAPPING_1
    Stage 2: Opening Task
    begin
    ERROR at line 1:
    ORA-20001: Task not found - Please check the Task Type, Name and Location are
    correct.
    ORA-06512: at "OWBSYS.WB_RT_API_EXEC", line 759
    ORA-06512: at "OWBSYS.WB_RT_SCRIPT_UTIL", line 910
    ORA-06512: at line 2When i execute this: i get the result as follows:
    SELECT warehouse_object_id, store_id, object_type_id, object_type_name, object_name FROM owb$wb_rt_warehouse_objects
    where object_name = 'MAPPING_1';
    WAREHOUSE_OBJECT_ID     STORE_ID                OBJECT_TYPE_ID          OBJECT_TYPE_NAME                                                 OBJECT_NAME                                                     
    15947                   15325                   769                     PLSQLMap                                                         MAPPING_1                                                       
    1 rows selectedEdited by: Chaitanya on Mar 5, 2012 3:33 AM

    Hi Chaitanya,
    Did you get any resolution for this error? I'm facing the same error while trying to execute OWB mapping through this command.
    Any help would be much appreciated. Thanks.
    Regards,
    Jagari

  • TS3274 My iPad has a white screen after trying to restore.  I try and restore again and  the same thing happens and we are back at the white screen.  How can I get it back.

    My iPad has a white screen after trying to restore.  I try and restore again and  the same thing happens and we are back at the white screen.  How can I get it back?

    type HT4097 in the search bar. its unable to update or restore iOS. Follow the instructions and if that does not work then id go to the local apple store.

  • BW7.3 SOURCE_PACKAGE and DATA_PACKAGE are incompatible in the Start Routine

    Hi Gurus,
    a face a strange behavior with BW7.3 and the Inventory Cube 0IC_C03:
    the standard scenario works well when I activate the cube and its transformations ..bx, bf and um. Then I have modified the InfoCube 0IC_C03 and added some field like 0customer or 0doc_number etc. I also added the fields to the InfoSource 2LIS_03_BF_TR and everything was as usual.
    Then I wanted to activate the transformation TRCS 2LIS_03_BF_TR -> CUBE 0IC_C03 when I had the error
    "E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is incompatible with the formal parameter "DATA_PACKAGE".
    I already tried to copy and paste the structure of tys_SC_1 to tys_SC_1_full but whenever I activate the transformation my changes are dropped while the error remains. I assume, that the problem is due the compilation process.
    Any hints to solve the problem? Thank you in advance.

    Hi Cemal,
    When we do the modifications at times the field structures inside the start routine are not update so that updation is required to be done manually. Copy the field list of structure (inside the start routine)  tys_SC_1 (this is gryed out i.e. change disabled) and paste the same structure to tys_SC_1_full & tys_TG_1_full.
    Check the routine and save it.
    Hopefully it will solve your problem.
    Regards,
    Dipika

  • SOURCE_PACKAGE and DATA_PACKAGE are incompatible in the start routine.

    Hi All,
       I have seen similar posts on the forums, but none relate to my issue. Here is what I am seeing.
       I have installed a cube, DSO and transformations b/w the cube and the DSO from the business content. The transformations cannot be activated as there is the following error in the end routine...
    E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter "SOURCE_PACKAGE" is incompatible with the formal parameter "DATA_PACKAGE".
    This is a fresh installation and I have not done any changes. The delivered version code (only the relevant portions) is as follows...
    Note: I have installed the transformations(TRFN) from the business content and have not migrated the update rules(UPDR) to transformations. So, this is an out of the box issue.
    METHODS
          start_routine
            IMPORTING
              request                  type rsrequest
              datapackid               type rsdatapid
            EXPORTING
              monitor                  type rstr_ty_t_monitors
            CHANGING
              SOURCE_PACKAGE              type tyt_SC_1
            RAISING
              cx_rsrout_abort.
    FORM routine_9998
    TABLES DATA_PACKAGE TYPE tyt_SC_1_full
      TABLES DATA_PACKAGE TYPE tyt_SC_1
      CHANGING
        ABORT          LIKE sy-subrc
      RAISING
        cx_sy_arithmetic_error
        cx_sy_conversion_error.
    Migrated update rule call
      Perform routine_9998
      TABLES
        SOURCE_PACKAGE
      CHANGING
        l_abort.
    Any help will be appreciated.
    Thanks.

    Hi,
    just try this code.
    METHODS
    start_routine
    IMPORTING
    request type rsrequest
    datapackid type rsdatapid
    EXPORTING
    monitor type rstr_ty_t_monitors
    CHANGING
    SOURCE_PACKAGE type tyt_SC_1
    RAISING
    cx_rsrout_abort.
    FORM routine_9998
    TABLES DATA_PACKAGE TYPE tyt_SC_1_full
    TABLES SOURCE_PACKAGE TYPE tyt_SC_1
    CHANGING
    ABORT LIKE sy-subrc
    RAISING
    cx_sy_arithmetic_error
    cx_sy_conversion_error.
    Migrated update rule call
    Perform routine_9998
    TABLES
    SOURCE_PACKAGE
    CHANGING
    l_abort.

  • I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date is created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    I have made a burn folder with photos exported from I-photo.  It now shows in information, that the date  created and modified is different from the original digitized date.  How can I get the original date to show in the info from Finder?

    The Finder reports File information. The date and time of the photo are in the Photo's Exif metadata. The Finder has no awareness of this. All photos apps on any system do.
    Regards
    TD

  • Why does ios7 not have the date (month, day and day of week at the top of the screen?   I have to bounce back to home page every time I need the date.  Perhaps someone can answer or pass this on to ios7 group!

    Anyone figure out how to let ios7 find the time zone it is in?    The little spoked wheel just keeps going round and round. 

    The return policy of the retailer where you purchased your iPad governs.
    If you bought from Apple, their policy would apply; since you purchased
    from other retailer, you must deal with them. No cheating is involved. Apple
    does not control the retailer. Take the retailer to court if you wish.

  • I am using CS5 and when I try to upgrade the packages: Bridge, Fireworks, and Photoshop are downloaded but the upgrades always fail -- why?

    I can upgrade other components of CS5 but not these three. What can I do to get these updates to be processed on my Windows 8.1 64-bit platform?

    you probably moved something.
    try updating directly,  http://www.adobe.com/downloads/updates/

  • Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

    Hello everybody,
         I am designing a general purpose block in system generator. I pass the user parameters to the block through masking it. Some user parameters can change the block configuration. The input port data type, width and rate can also affect the block configuration.
         The problem is that these values (input port data type, width and rate) are subject to change. So I should read them dynamically, then change the block configuration through programming the "Initialization Commands" field. But unfortunately there is no straight way to read the input port information.
         There are some methods in for example the "Black Box". these are:
    input_width = this_block.port('din').width;
    input_rate = this_block.port('din').rate;
    But these methods are not applicable to a masked subsystem.
    I have tried other ways also. You can find them below. None of them worked.
    Does anybody know how can I solve this problem?
    Other ways I tried:
    1)
    design_name([],[],[],'compile')                                       
    q=get_param(gcb,'PortHandles');
    get_param(q.Inport,'CompiledPortDataType')
    get_param(q.Inport,'CompiledPortWidth')
    get_param(q.Inport,'CompiledPortDimensions')
    design_name([],[],[],'term')
    2)
    ssGetInputPortDataType
    3)
    ts = Simulink.Block.getSampleTimes([gcb '/Input'])
     

    Today we rely on Simulink to perform parameterization of your designs in two ways:
    Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
    The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.
    To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:
    Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
    Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
    Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.
     

  • I need help in "HOW TO EXTEND THE DATA TYPE SYSTEM"......

    Hi All,
    I need to add new data type like SDO_GEOMETRY in spatial Oracle.
    I don't mean the User-Defined Datatype but new datatype embed in the database.
    I read the Data Cartridge Developer's Guide but it has info how to use more efficiently UDT through indexes.
    Anybody used the “Type System” under Databases and Extensibility Services?
    It might be written in C++ or Java but I do not know how.
    Any hints and help will be appreciated.
    Thanks,

    > In Figure 1-1 Oracle Services, there is a "Type System" as Oracle Services.
    The "Type System" is merely a compartmentalising the data type handling and implementation code/modules in Oracle.
    This covers all types. Oracle native types, user defined types (UDTs), etc.
    Saying that you want to create a new type in the "Type System" is basically saying you want to use the CREATE TYPE SQL command in Oracle.
    > So, I want new_type1 and new_type2 behave like other built-in types, just the way
    SDO_GEOMETRY works in Oracle Spatial Cartridge.
    Not familiar with the SDO_GEOMETRY. Why do you mention this type specifically? What do you want to do similar?
    > I have already done it with user-defined types. Now I need to do this way so that I can
    compare and contrast in terms of speed, space...etc for part of my research.
    Hmm.. I'm not sure what you are trying to compare ito of a UDT and Data Cartridge extensions. It is not one or the other. What research is this if I may ask?
    Simplistically you extend the Type System with a new UDT/ADT. And there you have a new type data can be used in the SQL Engine and the PL/SQL engine. The OCI (Oracle Call Interface) supports such types via the OCI object API calls - which means this new type can also be used from Oracle clients written in Delphi, C++, Java, etc.
    That new type can be a complex type. This type may need specific management code (memory management, context management, internationalisation, etc). To support this you can extend the UDT/ADT further by developing Cartridge Basic Service interfaces for the type - designing and writing management code to, for example, support specific internationalisation requirements when dealing with multibyte character sets.
    You can also extend the UDT/ADT to be custom managed ito indexing, determining query optimisation, computing costs of custom methods/functions/operators on this custom data type. These extensions are done by developing Data Cartridge interfaces for the type.
    Thus I cannot see what you are trying to compare. It is not one layer/interface versus another. These layers exist for all Oracle types (in the Type System). Oracle not only allows you to add to the top layer by adding/defining a new data type. It also allows you to customise (if needed) the layers below it.

  • Having trouble assigning the Data Type to Shared Variables

    I have some type definitions that I need to use as shared variables.  When making the shared variable, I create it and then name it.  I then select "From Custom Control..." in the Data Type field and select the applicable type definition.  The problem is that it displays some other type definition.  Am I doing something wrong?  I am using LV v.8.6. I don't recall having this problem with v.8.5.1.

    Hi Hunter,
    All the custom controls are set to Type Def.  Since sending my question, I noticed that the system uses the first similarly used custom control and it's name.  For example, I have several clusters that each have four numeric controls in them.  When creating a shared variable for each of the various clusters, it uses the first custom control that was set up as a shared variable.  I hope this makes sense to you.  I have not had a chance to see if the shared variables are working because I have other issues to deal with first. 
    What troubles me is that I don't recall seeing this with v.8.5.1.
    I suppose I could and perhaps should use a common type def for all similarly used shared variables.
    Dave

  • A new version of the data type is present than one required

    Hi  Experts,
    I am getting a short dump saying "A new version of the data type is present than one required".
    The data type in my case is the Transfer structure for 2LIS_02_SCL. I am getting this short dump whenever i try to change the transfer rules.
    I tried activating and deactivating the transfer and update rules but to no avail. Kindly advice.
    Thanks in advance.

    SAP Note 1157796 resolved the issue.

  • How to change the data type in the table ESLL for the field USERF2_NUM ?

    Hello Friends,
    I have a requirement in which one of the change is to convert the data type of the field 'USERF2_NUM' in the table 'ESLL'  from 'QUAN' to 'CHAR'. 
    How do i do it if i have an access to change it..........i think i should also check the impact of the change if done.
    Kindly tell me as my requirement starts with this small change.
    Regards,
    Rajesh Kumar

    Thanks for the reply Sowmya.
    I would like to know 2 things.
    1. Is it ok to change the data type of the field 'USERF2_NUM '  which is in the table ESLL. from quan to char.
    2.  The table ESLL  already has entries. if we change the data type from QUAN to CHAR what is the  effect on the existing entries of the table .
    Kindly reply me back.
    Thanks & Regards,
    Rajesh Kumar

  • I have dell xps it runs at 3840 x 2167 and bridge lightroom and photoshop are unusable as the type is so small if win is re scaled to a low res the products still use full res and you canot see text can you help!

    I am about to buy the above products for home and a laptop I bought the high res laptop for editing photos and the photos look great on the display but I cannot use photo shop and lightroom
    has any body had this problem and is there a simple fix that I have missed
    taking the res down in the control panel reduces the res but does not effect the programme
    by the way the dell xps is great
    dave

    Thanks for the info I know that there were problems with the high res
    I am using the latest photoshop and bridge from the cloud but only using the trial copy at the
    moment  
    I will look closer and try to scale it to a suitable level
    thanks dave
    Original message----
    From : [email protected]
    Date : 06/02/2015 - 00:39 (GMTST)
    To : [email protected]
    Subject :  i have dell xps it runs at 3840 x 2167 and bridge lightroom and photoshop are unusable as the type is so small if win is re scaled to a low res the products still use full res and you canot see text can you help!
        i have dell xps it runs at 3840 x 2167 and bridge lightroom and photoshop are unusable as the type is so small if win is re scaled to a low res the products still use full res and you canot see text can you help!
        created by gener7 in Photoshop General Discussion - View the full discussion
    There is that pitfall in buying HiDpi laptops for Windows.
    Only Photoshop CC 2014 has the option to scale the UI 200% in order to make it usable on these hires screens.
    CC and earlier does not have this and Adobe would have to retrofit them. Not likely with older products.
    Gene
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7167666#7167666 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7167666#7167666
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Photoshop General Discussion by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

Maybe you are looking for

  • How to read file from remote machine

    Hello, Hi, i would like to know how to read text file from remote machine using java source code, any code ? Thanks very much; Best regards Kim

  • Troubles with JRE 1.4.2 and iReport (with db2 connection)

    Hello everyone. My company is developing a product, and the client is working with JRE 1.4.2 . They (the client) are using db2 Database. We are using iReport to generate the product reports, but we encounter a problem with it - the report will compil

  • CRM to R3 partner flow via CRM Middleware ...

    Hi all , Any one can tell me where the setting of the filter in standard has been done for the fields of the BUT000 which flows to ECC R3 in the middleware . Actually the requirement is to send some specific data of all the ship_tos which is created

  • QuickTime stops immediately after opening on MacBook pro Mountain Lion

    All updates have been done, I did not install anything nieuw.Can anybody help?

  • Problem with New X-FI Titani

    I just got my new X-FI Fatalty Titanium Pro sound card in the mail today. I get it all set up properly, but when I plugged my Creative headset with microphone into the card I ran into some issues. I hear sound in my headset but the microphone is not